我有这个代码:
...
private void bBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string FileName = ofd.FileName;
tbKeyFile.Text = FileName;
}
if (!String.IsNullOrEmpty(tbKeyFile.Text))
{
FileStream fs = new FileStream(tbKeyFile.Text, FileMode.Open);
MD5 hashFunction = MD5.Create();
byte[] computedHashCode = hashFunction.ComputeHash(fs);
string HashInString = Convert.ToBase64String(computedHashCode);
lHash.Text = HashInString;
}
}
...
但它不计算 md5 哈希。它正在计算一个 SHA1 校验和。我做错了什么?