public static String Md5Encrypt(String strSource) { byte[] result = Encoding.Default.GetBytes(strSource); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); return BitConverter.ToString(output).Replace("-", ""); }