private void tbServicePort_KeyPress(object sender, KeyPressEventArgs e)
{
if(!char.IsDigit(e.KeyChar))
{
MessageBox.Show("请输入数字!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.Handled = true;//取消在控件中显示该字符
}
}