How to find user name for a task process running in windows 2k

M

Mo

Hi

I am using the System.Diagnostics.Process class to find information about the running process on, lets say win2k. I can get to almost all the information I need from the Process object except the user name that the process is running as. In the Task Manager, I can see the process Image Name, User Name, CPU, etc. Here is the code example of what I am doing

Process[] procs = null
string processList = ""
procs = Process.GetProcesses()
for(int i = 0; i <= procs.GetUpperBound(0); i++

Console.WriteLine(procs.ProcessName.ToString() + " is still responding!")


The question is, how can I get to the User Name for a specific process? Do I have to use Win API to do this? Thanks in advance

Cheer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top