C# 怎么杀死线程

mznxbc123456 2014-04-19 01:23:52
我在program.cs的main函数中创立了一个
//Thread to show splash window
Thread thUI = new Thread(new ThreadStart(ShowSplashWindow));
thUI.Name = "SplashUI";
//thUI.Priority = ThreadPriority.Normal;
thUI.IsBackground = true;
thUI.Start();

我现在想在我的form_load中将这个线程杀死,怎么杀死呢,请大神帮忙~
...全文
618 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
种草德鲁伊 2014-04-19
  • 打赏
  • 举报
回复
不用杀死,设定一个机制让它正常结束。
  • 打赏
  • 举报
回复
kill()就行了嘛
hudsonhuang 2014-04-19
  • 打赏
  • 举报
回复
http://www.cnblogs.com/yanyangtian/archive/2010/05/25/1743218.html 或者google .net task cancel
mznxbc123456 2014-04-19
  • 打赏
  • 举报
回复
引用 1 楼 hudsonhuang 的回复:
改task,然后token, cancel
没看懂
hudsonhuang 2014-04-19
  • 打赏
  • 举报
回复
改task,然后token, cancel

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧