private void button16_Click(object sender, EventArgs e)
{
using ( FileStream fs =
System.IO.File.OpenRead(@"c:\windows\notepad.exe") )
{
MD5 m5 = MD5.Create();
byte[] hash = m5.ComputeHash(fs);
string base64Hash = Convert.ToBase64String(hash);
Console.WriteLine("Base64 MD5 hash of Notepad.exe: " + base64Hash);
}
}
You can do the same kind of thing with SHA1, SHA128, etc.
--
William Stacey [MVP]
"Jesper" <Je****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
Gents,
I need the checksum of an xml file in order to verify that no changes has
been made to the file. How is this done.
Second, is it possible to 'embed' the MD5 checksum inside the very same
file. I guess not but perhaps if it is possible to make a partial checksum
not based on the first X characters of the file.
Thank you very