我知道以前有人问过这个问题,
但我似乎无法让它发挥作用。
我已调用以下内容:
using System.Management;
using System.Management.Instrumentation;
using System.Runtime.InteropServices;
我已经尝试过这个(我知道这很可悲,但这是我发现的最好的):
[DllImport("Cimwin32.dll")]
private void button1_Click(object sender, EventArgs e)
{
uint32 SetSpeed( //???
[in] uint64 300
);
}
如何通过c#设置电脑的风扇速度?
你的 PInvoke 不应该是这样的吗:
[DllImport("Cimwin32.dll")]
static extern uint32 SetSpeed(in uint64 sp);
private void button1_Click(object sender, EventArgs e)
{
SetSpeed(300);
}
这里还有一个 C++ 方法来执行此操作。您可以将其放入 DLL 中并从 C# 代码中调用它
如何在 Vista 中使用 C++ 控制 PC 的风扇速度? https://stackoverflow.com/questions/786984/how-can-i-control-my-pcs-fan-speed-using-c-in-vista
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)