Set fan speed to C #

I know this was asked before, but I just can't get it to work. I called the following:

using System.Management; using System.Management.Instrumentation; using System.Runtime.InteropServices; 

And I tried this (I know this is a pity, but its the best I have found):

  [DllImport("Cimwin32.dll")] private void button1_Click(object sender, EventArgs e) { uint32 SetSpeed( //??? [in] uint64 300 ); } 

How to set computer fan speed using C #?

+7
source share
1 answer

Shouldn't your PInvoke be like this:

 [DllImport("Cimwin32.dll")] static extern uint32 SetSpeed(in uint64 sp); private void button1_Click(object sender, EventArgs e) { SetSpeed(300); } 

The C ++ method is also used here. You can put this in a DLL and call it from your C # code

How can I control the rotation speed of your PC using C ++ in Vista?

+2
source

All Articles