免费刷qq名片赞在线刷:md5 算法问题 谢谢

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 18:56:15
运行出来都是0000000000 请高手赐教 网上就没有正确的 以下是源码

源码贴上不能发表 放在这里源码

谢谢了

http://www.phpwind.net/read.php?tid=210917

using System.Security.Cryptography;
using System.Text; //md5加密必须要这两个命名空间

MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider
StringBuilder sb = new StringBuilder();
byte [] strs=null;();//这些不用说了

public string Test(string strs)
{
strs=md5.ComputeHash(Encoding.ASCII.GetBytes(str));
for(int i=0;i<strs.Length ;i++)
{
sb.AppendFormat("{0:x2}",strs[i]);//加密表达式
}
return sb.tostring();
}