Пример #1
0
        private void btnStartHashCheck_Click(object sender, EventArgs e)
        {
            if (hashCheck.IsWorking)
            {
                hashCheck.Stop();
            }
            else
            {
                HashType hashType = (HashType)cbHashType.SelectedIndex;

                if (hashCheck.Start(txtFilePath.Text, hashType))
                {
                    btnStartHashCheck.Text = Resources.Stop;
                    txtResult.Text         = "";
                }
            }
        }
Пример #2
0
        private async void btnStartHashCheck_Click(object sender, EventArgs e)
        {
            if (hashCheck.IsWorking)
            {
                hashCheck.Stop();
            }
            else
            {
                btnStartHashCheck.Text = Resources.Stop;
                pbProgress.Value       = 0;
                txtResult.Text         = "";

                if (CompareTwoFiles)
                {
                    txtTarget.Text = "";
                }

                HashType hashType = (HashType)cbHashType.SelectedIndex;

                string filePath = txtFilePath.Text;
                string result   = await hashCheck.Start(filePath, hashType);

                if (!string.IsNullOrEmpty(result))
                {
                    txtResult.Text = result.ToUpperInvariant();

                    if (CompareTwoFiles)
                    {
                        string filePath2 = txtFilePath2.Text;
                        string result2   = await hashCheck.Start(filePath2, hashType);

                        if (!string.IsNullOrEmpty(result2))
                        {
                            txtTarget.Text = result2.ToUpperInvariant();
                        }
                    }
                }

                btnStartHashCheck.Text = Resources.Start;
            }
        }