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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top