Where should my Try Catch block be when running a thread?
问题 Take this thread: Thread thread = new Thread(delegate() { //Code }); thread.Start(); Should it be around the thread.Start(); or inside: Thread thread = new Thread(delegate() { try { //Code } catch (Exception) { //Code } }); 回答1: it is completely different to put then inside or outside. If you put them around the thread.Start() call, you can detect (according to this page: http://msdn.microsoft.com/en-us/library/system.threading.thread.start(v=vs.71).aspx) ThreadStateException The thread has