Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can get a list of running processes with their information</p> <pre><code>public static string ListAllProcesses() { StringBuilder sb = new StringBuilder(); // list out all processes and write them into a stringbuilder ManagementClass MgmtClass = new ManagementClass("Win32_Process"); foreach (ManagementObject mo in MgmtClass.GetInstances()) { sb.Append("Name:\t" + mo["Name"] + Environment.NewLine); sb.Append("ID:\t" + mo["ProcessId"] + Environment.NewLine); sb.Append(Environment.NewLine); } return sb.ToString(); } </code></pre> <p>The only method (That I know) to see if the process is opened by user or system is to check it's owner. If it's system, then it's not run by user:</p> <pre><code>//You will need to reference System.Management.Dll and use System.Management namespace public string GetProcessOwner(string processName) { string query = "Select * from Win32_Process Where Name = \"" + processName + "\""; ManagementObjectSearcher searcher = new ManagementObjectSearcher(query); ManagementObjectCollection processList = searcher.Get(); foreach (ManagementObject obj in processList) { string[] argList = new string[] { string.Empty, string.Empty }; int returnVal = Convert.ToInt32(obj.InvokeMethod("GetOwner", argList)); if (returnVal == 0) { // return DOMAIN\user string owner = argList[1] + "\\" + argList[0]; return owner; } } return "NO OWNER"; } </code></pre> <p>For the list of opened files, It is possible to do using Managed Code which is somehow hard. Here is an <a href="http://www.codeproject.com/KB/shell/OpenedFileFinder.aspx?fid=422864&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;fr=26&amp;select=2277170" rel="nofollow">example</a> on codeproject demonstrating the same matter</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload