Пример #1
0
        private void AddingToValidHashTable()
        {
            CheckSumTools checkSumTools = new CheckSumTools(cloningTool.HashesFile);

            string[] Hash_temp = new string[checkSumTools.GettingHashFileElements().lengthOfData];
            string[] path_temp = new string[checkSumTools.GettingHashFileElements().lengthOfData];
            for (int i = 0; i < checkSumTools.GettingHashFileElements().lengthOfData; i++)
            {
                Hash_temp[i] = checkSumTools.GettingHashFileElements().data[i].hashCode;
                path_temp[i] = checkSumTools.GettingHashFileElements().data[i].path;
                ValidHashTable.Rows.Add(path_temp[i], Hash_temp[i]);
            }
        }
Пример #2
0
        public Drivers(string drive_name, int drive_order, CloningTool Parent)
        {
            Drive_Worker            = new BackgroundWorker();
            Drive_Name              = drive_name;
            Drive_Order             = drive_order;
            Main_Form               = Parent;
            Loading_Status.Location = new Point(X_Location_status, Y_Location + drive_order * Y_Multiplier_Value);
            Complete_pic.Location   = new Point(X_Location, Y_Location + drive_order * Y_Multiplier_Value);
            Error_pic.Location      = new Point(X_Location, Y_Location + drive_order * Y_Multiplier_Value);
            Loading_pic.Location    = new Point(X_Location, Y_Location + drive_order * Y_Multiplier_Value);

            Main_Form.Controls.Add(Loading_pic);
            Main_Form.Controls.Add(Complete_pic);
            Main_Form.Controls.Add(Error_pic);
            Main_Form.Controls.Add(Loading_Status);

            CheckSumTools = new CheckSumTools(Main_Form.HashesFile);

            this.Drive_Worker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.Drive_Worker_DoWork);
            this.Drive_Worker.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.Drive_Worker_ProgressChanged);
            this.Drive_Worker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Drive_Worker_RunWorkerCompleted);
            Drive_Worker.WorkerReportsProgress    = true;
        }
Пример #3
0
        private void Browsing(DataGridView dataGridView)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Multiselect = true;
            int          i      = 0;
            DialogResult result = openFileDialog.ShowDialog(); // Show the dialog.

            string[] hashCode, fileNames;
            if (result == DialogResult.OK) // Test result.
            {
                hashCode  = new string[openFileDialog.FileNames.Length];
                fileNames = new string[openFileDialog.FileNames.Length];
                foreach (String file in openFileDialog.FileNames)
                {
                    try
                    {
                        CheckSumTools checkSumTool = new CheckSumTools(file);
                        string        text         = File.ReadAllText(file);
                        hashCode[i]  = checkSumTool.CheckSum_From_File(file);
                        fileNames[i] = file;
                    }
                    catch (IOException)
                    {
                    }
                    if (!duplicateValues(dataGridView, file))
                    {
                        dataGridView.Rows.Add(fileNames[i], hashCode[i]);
                        i++;
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }