#region MD5加密
/// <summary>
/// MD5加密
/// </summary>
/// <param name="Text">要加密的字符串</param>
/// <returns>string</returns>
public static string MD5(string Text)
{
byte[] buffer = System.Text.Encoding.Default.GetBytes(Text);
try
{
System.Security.Cryptography.MD5CryptoServiceProvider check;
check = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] somme = check.ComputeHash (buffer);
string ret = "";
foreach (byte a in somme)
{
if (a<16)
ret += "0" + a.ToString ("X");
else
ret += a.ToString ("X");
}
return ret ;
}
catch
{
throw;
}
}
#endregion