解决方案 »
- 怎样从身份证号中提取出生日期和性别。。帮个忙吧。俺是菜鸟
- 命名空间“System.Windows.Forms”中不存在类型或命名空间名称“FormClosingEventArgs”
- 关于C#抽象类的问题
- 关于"System.Web.UI.WebControls.ListViewItem" "DataItem" "DataItemIndex"
- 请问怎么通过API选定外部程序的TlistBox
- 怎样向WinForm中WebBrowser发送Enter回车键
- DatagridView自动排序怎样使最后一行不排序
- 影音文件远程播放问题,请高手共同研究
- UDP文件传输问题 请教
- asp.net中的下拉列表框问题
- vs有没有这样的一个快捷键:展开当前类的所有 函数的注释 ;
- 在c#中,动态和非静态的区别什么
int i = int.Parse(Console.ReadLine());
判断是否数字
int i;
string input = Console.ReadLine().Trim();
if(input.Length != 0 && int.TryParse(input, out i))
{
}
private void IntBool_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar >= 48 && (int)e.KeyChar <= 57 && textBox.Text.Length < 18 || (int)e.KeyChar == 8) //只能输入0-9数字和BackSpace
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}