Hi, I am designing a Task Manager like Application in C#. It displays the currently running processes. I used to get the Process detail using Process.StartInfo. But Process.StartInfo.UserName is empty for all process. How can get the UserName for the currently running processes.

Recommended Answers

All 2 Replies

Hi, I am designing a Task Manager like Application in C#. It displays the currently running processes. I used to get the Process detail using Process.StartInfo. But Process.StartInfo.UserName is empty for all process. How can get the UserName for the currently running processes.

Any luck mate? I have the same problem. Also FileName. And do you know how to get CPU usege?

On this msdn page I read: If you call the Start(ProcessStartInfo) method with the ProcessStartInfo.UserName and ProcessStartInfo.Password properties set, the unmanaged CreateProcessWithLogonW function is called, which starts the process in a new window even if the CreateNoWindow property value is true or the WindowStyle property value is Hidden.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.