-3

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 ...)

Community
  • 1
  • 1
TahsinGokalp
  • 15
  • 1
  • 4
  • @ken2k - Their [previous question](http://stackoverflow.com/questions/9343055/dllcache-folder-and-access-issue) posted today contains his attempt. – M.Babcock Feb 18 '12 at 19:03
  • http://meta.stackexchange.com/questions/60342/how-to-answer-do-my-work-for-me-questions – L.B Feb 18 '12 at 19:05

1 Answers1

1

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));

    }
}
Darin Dimitrov
  • 960,118
  • 257
  • 3,196
  • 2,876