处理64位进程 [英] Handle a 64bit process
问题描述
你好
首先,我不是一个专业人士,几天前才刚开始学习C#.
考虑到这一点,我有以下代码来处理流程:
Hello
First of all im a no pro and just started out learning c# a few days ago.
With that in mind i have the following code to handle a process:
public bool Process_Handle(string ProcessName)
{
try
{
Process[] ProcList = Process.GetProcessesByName(ProcessName);
if (ProcList.Length == 0)
return false;
else
{
pHandel = ProcList[0].Handle;
return true;
}
}
catch (Exception ex)
{
Console.Beep(); Console.WriteLine("Process_Handle - " + ex.Message);
return false;
}
}
当我尝试使用例如WinRAR时,它可以工作,我可以检查其是否正在运行等,但是当我想使用例如iw5mp.exe * 32(在任务管理器中)执行此操作时,我猜是一个64位程序,它只是说它找不到进程.
现在我的问题是如何进行编辑,以便process_handle可以处理包括64位进程在内的所有进程.
在此先非常感谢,我已经为此感到沮丧了.
When i try this with for example WinRAR it works i can check if its running or not etc but when i want to do this with for example iw5mp.exe*32 (in task manager), im guessing a 64bit program, it just says it didn''t find the process.
Now my question is how can i make edit it so that process_handle will handle all processes including 64bit processes.
Huge thanks in advance, i''ve been frustrated with this for quite some time now
推荐答案
那是使命召唤"程序吗?
尝试编写 iw5mp.exe ,而不是 iw5mp.exe * 32
That is ''Call of duty''''s program right?
Try writing iw5mp.exe as opposed to iw5mp.exe*32
这篇关于处理64位进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!