[C#] Get Hash From File

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Elite_Modz

Active Poster
Retired Staff
Active Member
Console ID Poster
Dec 19, 2014
517
380
133
Crunch
Reference:
Code:
using System.Security.Cryptography;
using System.IO;

Get MD5 Code 1:
Code:
#region GetMD5Hash
  public static string GetMD5HashFromFile(string filename)
  {
  using (var md5 = new MD5CryptoServiceProvider())
  {
  var buffer = md5.ComputeHash(File.ReadAllBytes(filename));
  var sb = new StringBuilder();
  for (int i = 0; i < buffer.Length; i++)
  {
  sb.Append(buffer[i].ToString("x2"));
  }
  return sb.ToString();
  }
  } //MessageBox.Show(GetMD5HashFromFile(""));

Get Md5 Code 2:
Code:
#region Computer_Get_MD5
  public static string Computer_Get_File_MD5(string filename)
  {
  using (var md5 = new MD5CryptoServiceProvider())
  {
  var buffer = md5.ComputeHash(File.ReadAllBytes(filename));
  var stringbuilder = new StringBuilder();
  for (int i = 0; i < buffer.Length; i++)
  {
  stringbuilder.Append(buffer[i].ToString("x2"));
  }
  return stringbuilder.ToString();
  }
  }//Computer_Get_File_MD5(filepath\file.txt)
  #endregion
 
Last edited:
General chit-chat
Help Users
  • No one is chatting at the moment.
  • @ LoveModz:
    Been a very long time.
  • @ QM|T_JinX:
    sup
  • Chat Bot:
    go88club4comm is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ lurch6661:
    zap zap
  • @ QM|T_JinX:
    zap
  • @ lurch6661:
    hey bro hows it going
  • @ QM|T_JinX:
    im good you
  • @ lurch6661:
    good bro just waking up
  • @ QM|T_JinX:
    haha cool
  • @ lurch6661:
    listening to old school lol
  • @ QM|T_JinX:
    nice
  • @ lurch6661:
    old school is best
  • @ QM|T_JinX:
    it is
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    heaven99 is our newest member. Welcome!
  • Chat Bot:
    Glenda is our newest member. Welcome!
  • Chat Bot:
    zandergum015 is our newest member. Welcome!
  • Chat Bot:
    RobertoNoc95 is our newest member. Welcome!
  • @ ⇜HUDSON⇝:
    not been on in years, sad seeing it like this man, was the place to be back in the day, fun times. :weed:hope all old members if they see this are good:peace: now who’s got a console
    +1
  • @ ⇜HUDSON⇝:
    Now who’s got a console ID for me :problemo:
    +1
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ QM|T_JinX:
    ⇜HUDSON⇝ said:
    Now who’s got a console ID for me :problemo:
    haha
      @ QM|T_JinX: Now who’s got a console ID for me :problemo:haha