雄安智能网站建设方案,网站规划说明书范文,不免费的网络营销方式,网站建设多少时间突然想在WP上用MD5 #xff0c;c#的MD5方法在SL下是不能用的额 搜索下MSDN#xff0c;找到解决方法#xff1a; http://archive.msdn.microsoft.com/SilverlightMD5 下载那两个类添加到工程中#xff0c;然后添加代码: 1: protected string GetMD5Hash(string input) 2: { …突然想在WP上用MD5 c#的MD5方法在SL下是不能用的额 搜索下MSDN找到解决方法 http://archive.msdn.microsoft.com/SilverlightMD5 下载那两个类添加到工程中然后添加代码: 1: protected string GetMD5Hash(string input) 2: { 3: byte[] bs System.Text.Encoding.UTF8.GetBytes(input); 4: MD5Managed md5 new MD5Managed(); 5: byte[] hash md5.ComputeHash(bs); 6: 7: StringBuilder sb new StringBuilder(); 8: foreach (byte b in hash) 9: { 10: sb.Append(b.ToString(x2).ToLower()); 11: } 12: return sb.ToString(); 13: } 使用的时候调用这个函数就OK了 比如 1: MessageBox.Show (GetMD5Hash(Hello World)); 效果 转载于:https://www.cnblogs.com/sun8134/archive/2012/03/17/2403960.html