當我如何開始從.NET應用程序`-energy`的Powercfg.exe?
using (var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "powercfg.exe",
Arguments = "-energy",
RedirectStandardOutput = true,
UseShellExecute = false,
}
})
{
process.Start();
process.WaitForExit();
}
它輸出:
庫診斷功耗效率(energy.dll)不 可能會被收取費用。
翻譯成英格爾斯:
能耗效率診斷庫(energy.dll)無法加載。
運行管理也是如此。
唯一的問題當從.NET執行應用程序時,當我在命令行調用它,它運行正常 – 2010-09-29 16:12:56
爲什麼d你有UseShellExecute =假? – dthorpe 2010-09-29 16:30:25
@dthorpe RedirectStandardOutput =''TRUE'需要UseShellExecute = – 2010-09-29 16:44:10