C#中的日期问题, 请您帮忙 没有,但你可以用try...catch...的方式解决。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如:static boolean IsDate(Object str){ try{ DateTime dt = Convert.ToDateTime(str); return true; }catch(Exception e){ return false; }}static boolean IsNumeric(Object str){ if (str == null){ return false; } String ss = str.ToString(); for (int i = 0; i < ss.Length; i++) { if (ss[i] < '0' || ss[i] > '9'){ return false; } } return true;} 日期只能是用try{}catch{}和类型转换来做,数字就自已判断了 C#如何操作word合并单元格,数据是动态生成的,不确定需要合并的行,只确定列。 Winform 窗口打开问题 c# 串口通信问题,高分求解 求助,关于ASP.NET中的一些操作不太明白 如何修改可执行文件的图标(在线等,急!!!) 有人有C#通口通信的例子吗? 关于C#中字符串中英文字符长度截取问题。(紧急呼救) C语言入门 在Form中嵌入Excel表格问题...请各位帮帮忙. 怎么把dataset里的内容添加到库? 为什么我的程序在98下就有些不能正常使用了? 怎样将字符串转换为浮点数?
static boolean IsDate(Object str){
try{
DateTime dt = Convert.ToDateTime(str);
return true;
}catch(Exception e){
return false;
}
}
static boolean IsNumeric(Object str){
if (str == null){
return false;
}
String ss = str.ToString();
for (int i = 0; i < ss.Length; i++) {
if (ss[i] < '0' || ss[i] > '9'){
return false;
}
}
return true;
}