private string SHA1(string str)
{byte[] strRes = Encoding.Default.GetBytes(str);
HashAlgorithm iSha = new SHA1CryptoServiceProvider();
strRes = iSha.ComputeHash(strRes);
StringBuilder enText = new StringBuilder();
foreach (byte iByte in strRes)
{enText.AppendFormat("{0:x2}", iByte);
}
return enText.ToString();}