C# 如何用按钮来结束程序运行.

nuliqianjing 2007-12-27 07:12:17
程序界面有两个按钮,当点击按钮run时程序开始运行,但不会停下来.这时需要点击EXIT 按钮来结束程序.但这时的EXIT 是不可用的,有那位高人给指点指点.万分感谢!
...全文
184 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
shulei521 2007-12-29
  • 打赏
  • 举报
回复
顶呀顶呀顶呀顶
wfwd 2007-12-29
  • 打赏
  • 举报
回复
TerminateProcess

The TerminateProcess function terminates the specified process and all of its threads.


BOOL TerminateProcess(
HANDLE hProcess,
UINT uExitCode
);

Parameters
hProcess
[in] Handle to the process to terminate.
Windows NT/2000/XP: The handle must have the PROCESS_TERMINATE access right. For more information, see Process Security and Access Rights.

uExitCode
[in] Exit code to be used by the process and threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve a process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.
csdn5211 2007-12-29
  • 打赏
  • 举报
回复
自己加个按钮写个退出函数就得了呗。
vrace 2007-12-29
  • 打赏
  • 举报
回复
请使用多线程
Treazy 2007-12-27
  • 打赏
  • 举报
回复
发错地方了吧~~~

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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