T
Tim
Hey guys,
I tried to get a process handle with the following code snippet:
00 Process[] processes = Process.GetProcesses();
01 if (null != processes && processes.Length > 0)
02 {
03 foreach (Process currentProcess in processes)
04 {
05 if (null != currentProcess)
06 {
07 if (currentProcess.Handle !=
Process.GetCurrentProcess().Handle)
08 {
09 if
(currentProcess.MainModule.FileName.ToLower().Contains("processname"))
10 {
11 currentProcess.Kill();
12 }
13 }
14 }
15 }
16 }
As soon as I reach line XX the framework will throw a Win32Exception
with the exception message "Access denied". The application should
have all needed user privileges because it runs as a service
application with the SYSTEM account permissions. As of this, I think
that my application will need additional .NET rights. Has somebody any
idea how to get the required permission? Thanks a lot.
Best regards,
Tim
I tried to get a process handle with the following code snippet:
00 Process[] processes = Process.GetProcesses();
01 if (null != processes && processes.Length > 0)
02 {
03 foreach (Process currentProcess in processes)
04 {
05 if (null != currentProcess)
06 {
07 if (currentProcess.Handle !=
Process.GetCurrentProcess().Handle)
08 {
09 if
(currentProcess.MainModule.FileName.ToLower().Contains("processname"))
10 {
11 currentProcess.Kill();
12 }
13 }
14 }
15 }
16 }
As soon as I reach line XX the framework will throw a Win32Exception
with the exception message "Access denied". The application should
have all needed user privileges because it runs as a service
application with the SYSTEM account permissions. As of this, I think
that my application will need additional .NET rights. Has somebody any
idea how to get the required permission? Thanks a lot.
Best regards,
Tim