如何检查程序在计算机中打开 [英] How to check program is opened during computer
本文介绍了如何检查程序在计算机中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果A必须知道B程序打开,A,B中有2台计算机。我该怎么办?
也许请参考 IP地址或计算机名称
单台计算机如下:
There are 2 computers in A,B
if A have to know B program opened. What should I do?
Maybe refer by IP Address or Computer name
The single computer as below :
private bool ProgramIsRunning(string FullPath)
{
string FilePath = Path.GetDirectoryName(FullPath);
string FileName = Path.GetFileNameWithoutExtension(FullPath).ToLower();
bool isRunning = false;
Process[] pList = Process.GetProcessesByName(FileName);
foreach (Process p in pList)
if(p.MainModule.FileName.StartsWith(FilePath, StringComparison.InvariantCultureIgnoreCase))
isRunning = true;
return isRunning;
}
ProgramIsRunning(@"c:\loc1\test.exe");
我的尝试:
我必须控制所有计算机程序打开
What I have tried:
I must control all the computer is program open
推荐答案
你是否要窥探别人的PC? :-)
你需要一台(可能TCP
)服务器在计算机上B
热衷于向您发送(即您的客户端程序)这样的信息。
Are you going to spy someone else's PC? :-)
You need a (possiblyTCP
) server on computerB
keen to sending you (i.e. your client program) such a piece of info.
这篇关于如何检查程序在计算机中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文