How to register a global hotkey for your application in C#

How to register a global hotkey for your application in C#

Register a hotkey for your application that can be triggered even if your form is minimized and does not have focus. More »

How to download a file in C# (progressbar and download speed)

How to download a file in C# (progressbar and download speed)

Learn how to download files in C# while displaying the percentage and the download speed. More »

UDP hole punching implementation in C#

UDP hole punching implementation in C#

Learn how to implement UDP hole punching so you can make your clients life a lot easier by not forcing them to open ports on their end. More »

 

Calculate file checksum

You might have noticed by now that a lot of websites list their files checksum values in their downloads section. Checksums are extremely useful when you want to verify that the file you have downloaded from another source is indeed the same file that is hosted on the official website and that it has not been altered in any way.

For this very reason I’ve put together a method that will generate the checksum of the file of your choice. Simply provide the location of the file and the algorithm you wish to compute the checksum with.

Examples:

Share on FacebookTweet about this on TwitterShare on Google+Share on StumbleUponShare on LinkedInShare on RedditPin on PinterestShare on TumblrDigg thisPrint this pageEmail this to someone

4 Responses to Calculate file checksum

  1. Denis says:

    I’m just learning some coding, so i was trying to create a program that does that, but i dont have enough knowledge :) i try to complete some of your posts! Any help is welcome!

    • CooLMinE says:

      The easiest way to compile C# (and VB.NET) source code, as well as to create applications, would be through the use of the Visual Studio IDE from Microsoft. It comes with a lot of features that speed up the development, allows for automatic error checking and so on. Best of all they even have a free version of the IDE called Visual Studio Express.

      Other than that start with the basics first as they are very important in order to understand what are you doing, which is crucial if you want to progress.

      The information at http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx should come in handy as well if you want to check it out.

  2. Denis says:

    How can we compile that? How to provide the algorithm? in what way?

    • CooLMinE says:

      The code above is in C#. If you are unfamiliar on how to compile the code you could use Microsoft’s File Checksum Integrity Verifier which will do the work for you. If you want to use the tool I mentioned the usage is fairly simple.

      Example for single file check: fciv.exe -add <file> -both. This will calculate both the md5 and sha1 hashes for you.

      For more detailed information about its usage simply run the program and it will display the help menu.

Leave a Reply

Your email address will not be published. Required fields are marked *