Simple MD5Sum Generator Used for Warm and Synergy Updater

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;

namespace WarmMD5Sum
    public partial class Form1 : Form
        public Form1()

        private void button1_Click(object sender, EventArgs e)
            // Get current application directory path
            string executableName = Application.ExecutablePath;
            FileInfo executableFileInfo = new FileInfo(executableName);
            string executableDirectoryName = executableFileInfo.DirectoryName;

            // Process the list of zip files found in directory where this program is running
            string[] fileEntries = Directory.GetFiles(executableDirectoryName, "*.zip");

            string filesProcessed = "Files Processed:" + Environment.NewLine + Environment.NewLine;

            foreach (string fileName in fileEntries)
                // Generate MD5Sum from file
                byte[] b = System.IO.File.ReadAllBytes(fileName);
                string sum = BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(b)).Replace("-", "").ToLower();

                // Create MD5Sum file  
                string MD5SumOutputFile = fileName + ".MD5Sum";
                TextWriter tw = new StreamWriter(MD5SumOutputFile);
                // Record what files were processed
                filesProcessed += fileName + Environment.NewLine + Environment.NewLine;



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s