File checksum

  • Thread starter Thread starter Jesper.
  • Start date Start date
J

Jesper.

Hi,

Once I heard something about a files checksum. Is there a
smart way to verify to some degree that the content of a
file has not been changed in C#.

best regards Jesper.
 
Hi,

You can compute a hash value (MD5 or SHA) on a file content, store it
somewhere and then re-compute the hash and compare to the stored value. If
they are not equal, the file has changed. .NET Framework has a built-in
implementation for hash computation in the System.Security.Cryptography
namespace.
 
Hash the file content.

To check for file modification:
Rehash the file content and compare to the above
 
Back
Top