The following code shows how to compute the MD5 based checksum of a local file
private string ComputeMD5Checksum(string path)
{
using (FileStream fs = System.IO.File.OpenRead(path))
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] fileData = new byte[fs.Length];
fs.Read(fileData, 0, (int)fs.Length);
byte[] checkSum = md5.ComputeHash(fileData);
string result = BitConverter.ToString(checkSum).Replace("-", String.Empty);
return result;
}
}