如题 求解 登陆界面如何 加入MD5加密界面MD5加密
解决方案 »
- 去除重复数字
- 怎么限制自定义控件的调用?
- 100分求助简单xml问题,在线等,急。
- [130]无法加载 DLL“xxx.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。
- 经过几天别扭的调试,发现我的问题出在了MDI上,由于不能上传文件,详情请进来,谢谢
- 请问异步SOCKET如何获取连接的客户端的信息??
- 连接问题
- 如何将多文档程序中子文档嵌入到toolStripContainer的中间面板中(在线等)??
- 儲存dataset為XML文件時可否按某個column排序的順序儲存
- C#的ExecutionEngineException异常?
- C# 如何播放音频字节 byte[]类型的。
- 程序语言更改
{
// Convert the input string to a byte array and compute the hash.
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); // Create a new Stringbuilder to collect the bytes
// and create a string.
StringBuilder sBuilder = new StringBuilder(); // Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
} // Return the hexadecimal string.
return sBuilder.ToString();
} // Verify a hash against a string.
public static bool VerifyMd5Hash(MD5 md5Hash, string input, string hash)
{
// Hash the input.
string hashOfInput = GetMd5Hash(md5Hash, input); // Create a StringComparer an compare the hashes.
StringComparer comparer = StringComparer.OrdinalIgnoreCase; if (0 == comparer.Compare(hashOfInput, hash))
{
return true;
}
else
{
return false;
}
}