Retrieve a complete processes list using C#

前端 未结 3 1121
遇见更好的自我
遇见更好的自我 2020-12-02 02:49

I am trying to write a C# program to retrieve a complete process list. However I find that an application open a window but I don\'t see it in the process tab of Windows tas

相关标签:
3条回答
  • 2020-12-02 03:34

    There are no hidden processes on Windows. Only processes you do not have (security) rights to see.

    A process running as an administrator (in Vista/Win7/Win2k8 would need to be elevated) will always be able to see all processes.

    However, a console application that lists the processes may well exit before Task Manager's display refreshes, and thus won't be seen. This is likely with a simple program even with update speed set to "high".

    You need to keep your process around until Task manager has updated its display. The simplest way would be do add the following statements to the end of your Main method:

    Console.Write("Press ENTER to exit");
    Console.ReadLine();
    
    0 讨论(0)
  • 2020-12-02 03:41

    I'm not sure what you mean. The code above lists the same number of processes as pslist. When you talk about methods to hide a process are you talking about root kits? If so they usually work by changing how the list commands work. I.e. the processes are in fact being enumerated, but the info is not displayed to the user.

    0 讨论(0)
  • 2020-12-02 03:45

    it works just fine all you need is add :

    Console.Write("Press ENTER to exit");
    Console.ReadLine();
    

    at the end or start project with ctrl + F5

    0 讨论(0)
提交回复
热议问题