Possible Duplicate:
How to compare 2 files fast using .NET?
How can I compare 2 sys files with same named in Dllcache and system32/drivers folders in order to sys file in system32/drivers is corrupted or not?with c#(md5 checksum or crc32 or ...)
Possible Duplicate:
How to compare 2 files fast using .NET?
How can I compare 2 sys files with same named in Dllcache and system32/drivers folders in order to sys file in system32/drivers is corrupted or not?with c#(md5 checksum or crc32 or ...)
You could compare their SHA1 hashes:
public string ComputeHash(string filename)
{
using(var sha1 = new SHA1CryptoServiceProvider())
{
byte[] fileData = File.ReadAllBytes(filename);
string hash = BitConverter.ToString(sha1.ComputeHash(fileData));
}
}