Security C# Tutorial

using System;
using System.IO;
using System.Security.Cryptography;
class MainClass
{
    public static void Main(string[] args)
    {
        using (HashAlgorithm hashAlg = new SHA1Managed())
        {
            using (Stream file = new FileStream("C:\\test.txt", FileMode.Open, FileAccess.Read))
            {
                byte[] hash = hashAlg.ComputeHash(file);
                // Display the hash code of the file to the console.
                Console.WriteLine(BitConverter.ToString(hash));
            }
        }
    }
}