private void button2_Click(object sender, EventArgs e) { if (MainKiller != null && MainKiller.IsRun) { MainKiller.Abort = true; Logger.Info(Util.MainThread, "终止主查杀线程"); } else { button2.Text = "停止扫描"; button2.BackColor = Util.huang; listBox1.Items.Clear(); ShowListBox(); SwitchLabel(true); MainKiller = new Killer(Util.CheckThread) { RootDir = textBox1.Text, SetLabelMethod = (string s) => label3.Text = s, SetProcessBarMethod = (int v) => progressBar1.Value = v, AddListMethod = AddList, FinishCheckMethod = FinishCheck }; MainKiller.SetOption(checkBox1.Checked, checkBox2.Checked, checkBox3.Checked); MainKiller.Run(); } }
public void RunSearch() { State = Status.Checking; USBKiller.Run(); }