c# winform 怎么 结束掉 某个方法, 如 getallstudent()

c# winform 怎么 结束掉 某个方法, 如 getallstudent()
让他退出线程 因为它 ,他在访问我图片
我另一个方法 无法 访问,提示图片已被 线程访问
要代码
不能笼统 ,我都是百度上找不到才问的

两个办法,结束线程 thread.Abort() ,记得用try catch对ThreadAbortException处理,清理线程。这个办法不推荐。
还有一个办法是使用一个ManualResetEvent,让工作线程自己退出 http://jingyan.baidu.com/article/0eb457e50949d203f1a9050f.html