using System.Security.Cryptography;
using System.Text;
private void SHA1Encode(string pwd)
{
SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] bytes1 = Encoding.UTF8.GetBytes(pwd);
byte[] bytes2 = sha1.ComputeHash(bytes1); // 第一次加密
byte[] bytes3 = sha1.ComputeHash(bytes2); // 第二次加密
string encode = Convert.ToBase64String(bytes3); //转Base64
sha1.Dispose();
}