8.2 Вычисление md5
12 февраля 2024 г.
15:57
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(@"C:\temp\Kitchen.pdf"))
{
var qq = md5.ComputeHash(stream);
string s = System.Text.Encoding.UTF8.GetString(qq);
string ww = BitConverter.ToString(qq).Replace("-", "").ToLowerInvariant();
// Create the file.
/* using (FileStream fs = File.Create(@"C:\temp\qwe1.txt"))
{
Byte[] info = new UTF8Encoding(true).GetBytes(s);
// Add some information to the file.
fs.Write(info, 0, info.Length);
} */
_Form.ShowMessage(ww);
}
}