go about finding the "Username" ("SYSTEM" / [user] etc) of that process, as listed in taskmanager?
foreach (Process proc in procs){// proc.(?)}
Or at least the originator of the process -- the System or one of the Users.
I tried to run my code only if the username is not "SYSTEM" using StartInfo.UserName, but that gives me the exception "Process was not started by this object, so requested information cannot be determined
if (proc.StartInfo.UserName != "SYSTEM") // Exception
{
}
If you don't care about adversarial usage, you can just check the env var probably
Обсуждают сегодня