Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > How to find user name for a task process running in windows 2k

Thread Tools

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

Posts: n/a

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[i].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


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
how can I find out the process ids with a process name herman Python 5 09-04-2007 11:05 PM
Accessing ant task name when running a task teggy Java 0 05-29-2007 02:20 PM
Main Application Crashes during running a external process task RBCS Perl Misc 1 02-14-2006 03:38 PM
perl script problem, windows task manager process name Ash Perl Misc 0 07-15-2004 01:19 AM