How to read command line arguments of another process in C#?

后端 未结 4 1077
南方客
南方客 2020-11-27 04:15

How can I obtain the command line arguments of another process?

Using static functions of the System.Diagnostics.Process class I can obtain a list of r

4条回答
  •  天涯浪人
    2020-11-27 05:02

    If you're targeting Windows XP or later and you can afford the overhead of WMI, a possibility would be to look up the target process using WMI's WIN32_Process class, which has a CommandLine property.

提交回复
热议问题