子晴的编程日记

记录我的编程日记

导航

2019年8月22日 #

验证是否是数字

摘要: //using System.Text.RegularExpressions; public static bool IsNumeric(string value) { return Regex.IsMatch(value, @"^[+-]?\d*[.]?\d*$"); } public stati 阅读全文

posted @ 2019-08-22 11:22 子晴的编程日记 阅读(131) 评论(0) 推荐(0) 编辑

验证连接数据库方法

摘要: private static SqlConnection mySqlConnection; private static bool IsCanConnectioned = false; public bool GetConnection() { mySqlConnection = new SqlCo 阅读全文

posted @ 2019-08-22 11:20 子晴的编程日记 阅读(314) 评论(0) 推荐(0) 编辑

验证时间方法

摘要: private bool ChkDate(string str) { try { DateTime t1 = DateTime.Parse(str); return true; //返回真 } catch { return false; } } 阅读全文

posted @ 2019-08-22 11:19 子晴的编程日记 阅读(209) 评论(0) 推荐(0) 编辑