C# winform 中 MD5 加密
using System.Security;
using System.Security.Cryptography;
MD5 md5=new MD5CryptoServiceProvider();
byte[] bt=Encoding.Default.GetBytes("待加密字符串");//将待加密字符转为 字节型数组
byte[] resualt=md5.ComputeHash(bt);//将字节数组转为加密的字节数组
string pwds = BitConverter.ToString(resualt).Replace("-","");//将数字转为string 型去掉内部的无关字符
using System.Security.Cryptography;
MD5 md5=new MD5CryptoServiceProvider();
byte[] bt=Encoding.Default.GetBytes("待加密字符串");//将待加密字符转为 字节型数组
byte[] resualt=md5.ComputeHash(bt);//将字节数组转为加密的字节数组
string pwds = BitConverter.ToString(resualt).Replace("-","");//将数字转为string 型去掉内部的无关字符
浙公网安备 33010602011771号