Hi,
I wondering where should i use finally and where should i use catch?
I have a thread, which the thread dispatcher waits for the thread. if i
abort the
thread, an exception happens. why should i use finally and not catch as
below?
for exmple?
private void button1_Click(object sender, EventArgs e)
{
myThread = new Thread(myThreadDelegate);
myThread.Start();
}
void threadcreatore()
{
try
{
Workerthread Workerthreadob = new Workerthread();
Workerthreadob.thdRunnerEngine();
}
finally
{
MessageBox.Show("In finally");
}
}
private void button2_Click(object sender, EventArgs e)
{
myThread.Abort();
}
You can see good sample in
http://www.yoda.arachsys.com/csharp/...shutdown.shtml
thanks,