如何开始从.NET应用程序'的Powercfg.exe -energy`? [英] How to start `powercfg.exe -energy` from a .NET app?
本文介绍了如何开始从.NET应用程序'的Powercfg.exe -energy`?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我
using (var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "powercfg.exe",
Arguments = "-energy",
RedirectStandardOutput = true,
UseShellExecute = false,
}
})
{
process.Start();
process.WaitForExit();
}
它输出:
有一个藏书德Diagnóstico日Eficiência日Consumo德能源公司(energy.dll)NAO 颇得SER carregada。
A biblioteca de Diagnóstico de Eficiência de Consumo de Energia (energy.dll) não pôde ser carregada.
翻译成英文:
能源消耗效率诊断库(energy.dll)不能被加载。
The Energy Consumption Efficiency Diagnostic library (energy.dll) couldn't be loaded.
即使运行的管理。
推荐答案
我怕我不能重复你的结果;我得到的结果文件的预期。但是,如果有帮助,也许是我的测试参数可以帮助你缩小了可能会在您的环境的罪魁祸首:
I'm afraid I cannot duplicate your results; I get the results file as expected. But if it helps, perhaps my testing parameters will help you narrow down what may be the culprit in your environment:
- 在运行Visual Studio 2010中以管理员身份
- 目标.NET 4客户端配置文件
- 在编译x86和任何CPU二进制文件
- 在计算机运行的是Windows 7 64位系统
这篇关于如何开始从.NET应用程序'的Powercfg.exe -energy`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文