using (var md5 = MD5.Create())
{
    using (var stream = File.OpenRead(filename))
    {
        return md5.ComputeHash(stream);
    }
}

http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file