更新时间:2022-10-31 15:49:21
当系统中打开一个可执行文件时......会有一个与文件名完全相同的进程。例如,如果你正在寻找一个名为的System文件:SystemCleaner.exe你可以找到一个名为SystemCleaner的进程。
因此,如果文件名有空格,例如:System Cleaner.exe然后你将寻找一个名为:System Cleaner的过程。
您可以计算系统中存在多少具有特定名称的进程..使用以下代码行(在C#中):
When an executable is open in the system... there will be a process with the exact same name as the file. For example if you are looking for an exe file which is called: SystemCleaner.exe you can find it as a process with the name: SystemCleaner.
Accordingly if the file name has a space, for example: System Cleaner.exe Then you will looking for a process called: System Cleaner.
You can count how many processes with a specific name exist in the system.. with the following lines of code(in C#):
int counter = 0;
foreach (Process process in Process.GetProcessesByName("SystemCleaner"))
{
counter++;
}
if(counter > 0)
{
YourButtonName.Visible = true;
}
else
{
YourButtonName.Visible = false;
}