c# 关闭进程
来源:互联网 发布:static java 编辑:程序博客网 时间:2024/04/30 22:54
//关闭进程
public void KillProcess(string processName)
{
System.Diagnostics.Process myproc = new System.Diagnostics.Process();
//得到所有打开的进程
try
{
foreach (Process thisproc in Process.GetProcessesByName(processName))
{
if (!thisproc.CloseMainWindow())
{
if (thisproc != null)
thisproc.Kill();
}
}
}
catch (Exception Exc)
{
throw Exc;
// msg.Text+= "杀死" + processName + "失败!";
}
}
public void KillProcess(string processName)
{
System.Diagnostics.Process myproc = new System.Diagnostics.Process();
//得到所有打开的进程
try
{
foreach (Process thisproc in Process.GetProcessesByName(processName))
{
if (!thisproc.CloseMainWindow())
{
if (thisproc != null)
thisproc.Kill();
}
}
}
catch (Exception Exc)
{
throw Exc;
// msg.Text+= "杀死" + processName + "失败!";
}
}
- C# 关闭某个进程
- c# 关闭进程
- c# 关闭指定进程
- C# 关闭进程
- C#关闭进程
- c# 强制关闭进程
- C# 关闭EXCEL进程
- C#关闭进程树
- C# Excel进程关闭
- c#启动关闭进程
- C# 关闭进程
- C# 关闭 Excel进程
- C#关闭进程树
- c# 关闭excel进程
- c# 启动关闭进程
- c# 启动关闭进程
- C#关闭进程树
- C#关闭后台进程
- Winform 界面的动态翻译
- 正式在此开博
- CSDN
- c# class copy class
- JSP
- c# 关闭进程
- c# word 在当前光标位置插入内容
- js 删除确定
- 用Setup Factory打包基于.Net的WinForm程序
- 序列化
- rails2.3页面中文乱码解决方案
- 处理表重复记录(查询和删除)
- 考研复试准备中
- VC6与VS2005冲突