zoukankan
html css js c++ java
杀线程的代码(转自CSDNcyfboy)
private
void
KillProcess(
string
processName)
{
System.Diagnostics.Process myproc
=
new
System.Diagnostics.Process();
//
得到所有打开的进程
try
{
foreach
(Process thisproc
in
Process.GetProcessesByName(processName))
{
if
(
!
thisproc.CloseMainWindow())
{
thisproc.Kill();
}
}
}
catch
(Exception Exc)
{
MessageBox.Show(Exc.ToString());
}
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
String tempName
=
""
;
int
begpos;
int
endpos;
foreach
(Process thisProc
in
System.Diagnostics.Process.GetProcesses())
{
tempName
=
thisProc.ToString();
begpos
=
tempName.IndexOf(
"
(
"
)
+
1
;
endpos
=
tempName.IndexOf(
"
)
"
);
tempName
=
tempName.Substring(begpos, endpos
-
begpos);
//
this.listBox1.Items.Add(tempName);
if
(tempName
==
"
newfax
"
)
{
KillProcess(tempName);
}
}
}
查看全文
相关阅读:
redis 命令
继续node爬虫 — 百行代码自制自动AC机器人日解千题攻占HDOJ
redis Ok2
ThinkPHP5 清除runtime缓存文件
linux系统下使用xampp 丢失mysql root密码 只能远程访问,本地无法连接数据库
yii2 验证规则使用方法
thinkphp5 模型表关联
PHP将base64数据流转换成图片并保存
Win10下80端口被System占用导致Apache无法启动
3. Git与TortoiseGit基本操作
原文地址:https://www.cnblogs.com/Magicsky/p/525312.html
最新文章
Linux系统安装mysql数据库
ArrayList解析
HashMap源码分析
CSS 巧用 :before和:after
正则
程序员在页面友好性上常犯的5种错误以及改正方法
animation
Zone.js
php unicode
都是以父元素的width为参照物的
热门文章
wechat
GET /hello/fred/0926xxx572
ng-repeat的group
NodeJs编写小爬虫
meta
appjs desktop2
appjs desktop
soap
ionic build --release android
redis
Copyright © 2011-2022 走看看