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

Discussion in 'ASP .Net Security' started by Mo, May 4, 2004.

  1. Mo

    Mo Guest

    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
    Mo, May 4, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor
    Replies:
    0
    Views:
    8,836
    Victor
    Sep 1, 2004
  2. teggy
    Replies:
    0
    Views:
    815
    teggy
    May 29, 2007
  3. herman
    Replies:
    5
    Views:
    312
    Karthik Gurusamy
    Sep 5, 2007
  4. Ash
    Replies:
    0
    Views:
    574
  5. RBCS
    Replies:
    1
    Views:
    137
    A. Sinan Unur
    Feb 14, 2006
Loading...

Share This Page