Hello,
I am trying to force a service to close if it is hanging in 'Stopping' status and wanted to use:
This does not work, says index is outside the range, which means there is nothing in the list for it to evaluate. I suspect this will not work with services but only applications.
Can someone please direct me to a way of accessing the processes Pid so i can carry out the tasks i require.
Many thanks.
I am trying to force a service to close if it is hanging in 'Stopping' status and wanted to use:
Code:
pId = System.Diagnostics.Process.GetProcessesByName(ServiceName)[0].Id;
Can someone please direct me to a way of accessing the processes Pid so i can carry out the tasks i require.
Many thanks.