简体   繁体   English

如何使用C#在Windows 2000上获取进程命令行参数

[英]How to get process Commandline Parameters on Windows 2000 using C#

How to get process Commandline Parameters at Windows 2000 using C#? 如何使用C#在Windows 2000上获取进程命令行参数?

I'm use WMI query :select ExecutablePath,CommandLine from Win32_Process where Name='test' but windows 2000 throw this exception: system.management.managementexception : invalid query. 我正在使用WMI查询:从Win32_Process中选择ExecutablePath,CommandLine,其中Name ='test'但是Windows 2000抛出此异常:system.management.managementexception:无效查询。

so I do not know how to do it work in windows 2000,please help me, Thank you! 所以我不知道如何在Windows 2000中工作,请帮帮我,谢谢!

The CommandLine -property exists since Windows XP ( msdn source ): 自Windows XP( msdn源代码 )以来, CommandLine -property存在:

CommandLine 命令行
Data type: string 数据类型:字符串
Access type: Read-only 访问类型:只读
Command line used to start a specific process, if applicable. 用于启动特定进程的命令行(如果适用)。 This property is new for Windows XP. 此属性是Windows XP的新增功能。

Related SO question: WMI error with a simple query in C# 相关的问题: 在C#中使用简单查询的WMI错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM