using System;
using System.Diagnostics;
using System.ComponentModel;namespace MyProcessSample
{
/// <summary>
/// Shell for the sample.
/// </summary>
class MyProcess
{
void BindToRunningProcesses()
{
// Get all processes running on the local computer.
Process [] localAll = Process.GetProcesses();
for(int i=0;i<localAll.Length;i++)
{ if(localAll[i].ProcessName==你要检测的进程名字)
{处理代码}
}
}
using System.Diagnostics;
using System.ComponentModel;namespace MyProcessSample
{
/// <summary>
/// Shell for the sample.
/// </summary>
class MyProcess
{
void BindToRunningProcesses()
{
// Get all processes running on the local computer.
Process [] localAll = Process.GetProcesses();
for(int i=0;i<localAll.Length;i++)
{ if(localAll[i].ProcessName==你要检测的进程名字)
{处理代码}
}
}
解决方案 »
- C#调用CMD执行字符问题崩溃中,泪奔求指
- winform程序自启动后无法读取XML配置文件中的信息!!!
- 如何保存图片到数据库中
- 有tabcontrol的自定义控件,拉到Form窗体上出了问题(VS2008)
- e.Graphics.DrawString("this is font", this.Font, Brushes.Black, 100, 9);
- C#里面有没有什么方法或函数来判断一个字符串是不是数字.
- 新闻系统问题求助
- DEVExpress FOR .net 组件的注册吗
- 100 分 ! 谁有 c#的 查找,替换 windows 文本文件 中的 指定字符串 的程序,字符串可以大批量???
- TextBox透明
- c#应用程序中删除字段的问题
- 添加的文本文件的路径???
foreach (Process p in pp)
{//p.ProcessName就是名字,其他p.Id等等}
{
if (p.ProcessName == "your process")
{
//do something
}
}
if (vProcesses.Length > 0) MessageBox.Show("iexplore已经打开");