📄 certification.cs
字号:
using System;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace HRMan
{
class Certification
{
public Certification()
{
}
public static bool IsValidNumber(string str)
{
return Regex.IsMatch(str, "^[0-9]*[1-9][0-9]*$");
}
//判断是否为电话号码
public static bool IsValidPhono(string str)
{
return Regex.IsMatch(str, @"(\d+-)?(\d{4}-?\d{7}|\d{3}-?\d{8}|^\d{7,8})(-\d+)?");
}
//判断是否为有效身份证
public static bool IsValidNo(string str)
{
return Regex.IsMatch(str, @"\d{15}|\d{17}[\dXx]");
}
//判断是否为有效日期
public static bool IsValidData(string str)
{
string ss = @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$";
return Regex.IsMatch(str, ss);
}
public static string ReadText(int n)
{
StringBuilder sb = new StringBuilder();
string str = "select * from ColName where colId=" + n;
DataTable dt = new DataTable();
DataAccess DA = new DataAccess();
dt = DA.ExeSQLdt(str);
for (int i = 0; i < dt.Rows.Count; i++)
{
sb.Append(dt.Rows[i]["colName"].ToString() + "#");
}
return sb.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -