I'm working on an example for making a thread start and stop and continue after stopping.
I wrote code for starting, but I don't know how to stop the thread. If anyone knows how, please show me where to edit my code.
private void startBtn_Click(object sender, EventArgs e)
{
//START BG WORKER
backgroundWorker1.RunWorkerAsync();
Thread thr = new Thread(Start);
thr.SetApartmentState(ApartmentState.STA);
thr.Start();
}
static void Start()
{
var dr = new ChromeDriver();
dr.Navigate().GoToUrl("http://www.google.com");
dr.Navigate().GoToUrl("http://www.facebook.com");
}
private void cancelBtn_Click(object sender, EventArgs e)
{
}
private void contiBtn_Click(object sender, EventArgs e)
{
}