Example #1
0
        private void CalculateMD5Thread()
        {
            this.button1.Enabled = false;
            this.button2.Enabled = false;
            this.button3.Enabled = false;
            this.button4.Enabled = false;
            MD5Algo ma = new MD5Algo(new MD5Algo.Progress(ProgressCallBack));

            foreach (string fn in TestFiles)
            {
                string Extension = Path.GetExtension(fn).ToUpper();

                if (!Extension.Equals(".MD5"))
                {
                    pvw.Init();
                    string MD5Sum = ma.CalculateMD5(fn);
                    if (MD5Sum != null)
                    {
                        if (StoreMD5Sum(MD5Sum, fn))
                        {
                            this.listView1.Items.Add(new ListViewItem(fn));
                        }
                    }
                }
            }
            pvw.Close();
            this.button1.Enabled = true;
            this.button2.Enabled = true;
            this.button3.Enabled = true;
            this.button4.Enabled = true;
        }
Example #2
0
        private void ValidateMD5Thread()
        {
            this.button1.Enabled = false;
            this.button2.Enabled = false;
            this.button3.Enabled = false;
            this.button4.Enabled = false;
            MD5Algo ma = new MD5Algo(new MD5Algo.Progress(ProgressCallBack));

            foreach (string fn in TestFiles)
            {
                if (!Path.GetExtension(fn).ToUpper().Equals(".MD5"))
                {
                    pvw.Init();
                    string MD5Sum     = ma.CalculateMD5(fn);
                    string MD5SumOrig = ReadMD5Sum(fn);
                    if (MD5SumOrig != null)
                    {
                        string[] Result = new string[2];
                        Result[0] = fn;
                        if (MD5SumOrig.Equals(MD5Sum))
                        {
                            Result[1] = "OK";
                        }
                        else
                        {
                            Result[1] = "Error";
                        }
                        this.listView1.Items.Add(new ListViewItem(Result));
                    }
                }
            }
            pvw.Close();
            this.button1.Enabled = true;
            this.button2.Enabled = true;
            this.button3.Enabled = true;
            this.button4.Enabled = true;
        }