I try this:
int yourProcess = Process.GetProcessesByName( "notepad.exe" )[0].Id;
all i get is this error:
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
can anyone help?
I try this:
int yourProcess = Process.GetProcessesByName( "notepad.exe" )[0].Id;
all i get is this error:
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
can anyone help?
You tried to get processes by their name, but you didn't find any. That's your only error, you should specify a friendly name of the process. Or rather iterate through all processes and find the one you need.