viRow.EndEdit();
ds.Merge(dt);
}
检验输入数据是数字还是字母的方法:
public void Test(string strTest, out int intTest)
{
if (Regex.IsMatch(strTest,
"^((\\+|-)\\d)?\\d*(\\d|[.]\\d|[.]\\d\\d|[.]\\d\\d\\d)$") == false)
{
intTest = 1;
}
else
{
intTest = 0;
}
}
用户密码加密输出方法:
public string mmjmsc(string lc_srmm)
{
Byte[] clearBytes = new UnicodeEncoding().GetBytes(lc_srmm);
Byte[] hashedBytes =
((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
return BitConverter.ToString(hashedBytes);
}
|