Once the file is created and you know it is good, create an MD5 hash
of it. Then, in the future, you can create another MD5 hash and
compare the value to the original. If one BIT is different you will
get a different hash.
Here is a routine that will give you the MD5 hash of a file.
public string Compute_MD5Hash_FromFile(string FileNameAndPath)
{
using (FileStream fs = new FileStream(FileNameAndPath,
FileMode.Open))
{
return Convert.ToBase64String(new
MD5CryptoServiceProvider().ComputeHash(fs));
}
}
http://www.codershangout.com
On Feb 8, 7:39 am, giftson.j...@gmail.com wrote:
Hi,
Anybody knows how to check the file integrity?
I need to check the file integrity whether it is corrupt or not. Can
anyone please advice?