Here's the code you can use to get started.
If you get
LINQPad - The .NET Programmer's Playground[
^] you can drop the code into a new file and run it and see the output.
void Main()
{
var tempFile1 = Path.GetTempFileName();
File.AppendAllText(tempFile1, "this is a test");
Byte [] allBytes = File.ReadAllBytes(tempFile1);
System.Security.Cryptography.HashAlgorithm md5Algo = null;
md5Algo = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hash = md5Algo.ComputeHash(allBytes);
Console.WriteLine(BytesToHex(hash));
File.Delete(tempFile1);
}
private string BytesToHex(byte[] bytes)
{
return String.Concat(Array.ConvertAll(bytes, x => x.ToString("X2")));
}