![](/img/trans.png)
[英]How to get return value of the Format method of the Win32_Volume class using void ManagementObject.InvokeMethod(…)?
[英]Get processId and returnValue from ManagementObject.InvokeMethod Method
我正在使用 WMI 遠程執行命令,如本文檔中所述:
//Execute the method
object result =
processClass.InvokeMethod(
"Create", methodArgs);
//Display results
Console.WriteLine(
"Creation of process returned: " + result);
我需要從result
對象中檢索 PID 和返回值(不是作為字符串,而是兩個單獨的值),但文檔沒有提到它。
有人知道嗎?
ProcessId 和 returnValue 可以這樣獲取:
UInt32 retcode =
processClass.InvokeMethod(
"Create", methodArgs);
UInt32 pid = methodArgs[3];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.