可以使用WMI來查詢得到數據,代碼如下(記得引用System.Management)
foreach (System.Management.ManagementObject p in
new System.Management.ManagementObjectSearcher(
new System.Management.SelectQuery("SELECT * FROM Win32_Process")
).Get()
)
Console.WriteLine(p.PropertIEs["commandLine"].Value);
技術討論的QQ群: 2514097 或 10987609