MD5加密

来源:互联网 发布:mac 共享文件夹 防火墙 编辑:程序博客网 时间:2024/05/16 13:39
using System.Security.Cryptography;
public string GetStrMD5Code(string Srcstr)        {            MD5CryptoServiceProvider md5csp = new MD5CryptoServiceProvider();            byte[] SrcBytes = Encoding.Default.GetBytes(Srcstr);            byte[] MD5Bytes = md5csp.ComputeHash(SrcBytes);            string MD5Code = BitConverter.ToString(MD5Bytes);            MD5Code = MD5Code.Replace("-","");//替换MD5中的“-”            return MD5Code;        }

原创粉丝点击