I'm trying to get a list of processes currently owned by the current user (Environment.UserName
). Unfortunately, the Process
class doesn't have any way of getting the UserName of the user owning a process.
How do you get the UserName of the user which is the owner of a process using the Process
class so I can compare it to Environment.UserName
?
If your solution requires a pinvoke
, please provide a code example.