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 型去掉内部的无关字符
posted @ 2009-07-31 15:41  94cool  阅读(724)  评论(0)    收藏  举报