?? certification.cs
字號(hào):
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]*$");
}
//判斷是否為電話號(hào)碼
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();
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -