110,534
社区成员
发帖
与我相关
我的任务
分享
public static bool IsAppStart(String AppName,String AppPath)
{
System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(AppName);
foreach (System.Diagnostics.Process myProcess in myProcesses)
{
string ProcessFile = myProcess.Modules[0].FileName;
FileInfo Myfile = new FileInfo(ProcessFile);
if (Myfile.DirectoryName.ToLower() == AppPath.ToLower())
{
return true;
}
}
return false;
}