Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to get fan properties?

How to get fan properties?

Scheduled Pinned Locked Moved C#
performancetutorialquestionlounge
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yeast27
    wrote on last edited by
    #1

    I wish to find a general method for retriving fan's properties such as speed as well as CPU temperature, how could I go about doing it? I tried to use win32_fan but it doesn't give me back anything.

    H 1 Reply Last reply
    0
    • Y Yeast27

      I wish to find a general method for retriving fan's properties such as speed as well as CPU temperature, how could I go about doing it? I tried to use win32_fan but it doesn't give me back anything.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Please post some sample code for how you used Win32_Fan. It's also possible that your drivers don't expose data correctly for the WMI class to view. You need to be sure your motherboard drivers are installed correctly and that they even expose the data you want. If they don't, there may be no practical way of getting it, short of knowing the details specs for the fan and writing assembler to get such information. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

      Y 1 Reply Last reply
      0
      • H Heath Stewart

        Please post some sample code for how you used Win32_Fan. It's also possible that your drivers don't expose data correctly for the WMI class to view. You need to be sure your motherboard drivers are installed correctly and that they even expose the data you want. If they don't, there may be no practical way of getting it, short of knowing the details specs for the fan and writing assembler to get such information. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

        Y Offline
        Y Offline
        Yeast27
        wrote on last edited by
        #3

        This is the coding I used... I work fine for other properties such as processor though. ManagementObjectSearcher Fan = new ManagementObjectSearcher("Select * from Win32_Fan"); foreach(ManagementObject item in Fan.Get()) { Text.WriteLine(" {0} ",item.GetPropertyValue("ActiveCooling")); Text.WriteLine(" {0} ",item.GetPropertyValue("Description")); Text.WriteLine(" {0} ",item.GetPropertyValue("DeviceID")); Text.WriteLine(" {0} ",item.GetPropertyValue("Name")); Text.WriteLine(" {0} ",item.GetPropertyValue("Status")); Text.WriteLine(" {0} ",item.GetPropertyValue("VariableSpeed")); Text.WriteLine(""); }

        H 1 Reply Last reply
        0
        • Y Yeast27

          This is the coding I used... I work fine for other properties such as processor though. ManagementObjectSearcher Fan = new ManagementObjectSearcher("Select * from Win32_Fan"); foreach(ManagementObject item in Fan.Get()) { Text.WriteLine(" {0} ",item.GetPropertyValue("ActiveCooling")); Text.WriteLine(" {0} ",item.GetPropertyValue("Description")); Text.WriteLine(" {0} ",item.GetPropertyValue("DeviceID")); Text.WriteLine(" {0} ",item.GetPropertyValue("Name")); Text.WriteLine(" {0} ",item.GetPropertyValue("Status")); Text.WriteLine(" {0} ",item.GetPropertyValue("VariableSpeed")); Text.WriteLine(""); }

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          When you step through (debug) your code, do you get any results with Fan.Get()? If not, then the problem is as I suspect: information about your CPU fan is not available. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

          Y 1 Reply Last reply
          0
          • H Heath Stewart

            When you step through (debug) your code, do you get any results with Fan.Get()? If not, then the problem is as I suspect: information about your CPU fan is not available. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

            Y Offline
            Y Offline
            Yeast27
            wrote on last edited by
            #5

            I didn't get anything... I had tried with some other freeware program too but it didn't come up, perhaps it is like you said that the information is not available, however I had tried with several other computer and it didn't come up.... should I do programming on bios level or something like that? Thank yah,

            H 1 Reply Last reply
            0
            • Y Yeast27

              I didn't get anything... I had tried with some other freeware program too but it didn't come up, perhaps it is like you said that the information is not available, however I had tried with several other computer and it didn't come up.... should I do programming on bios level or something like that? Thank yah,

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              That may not help. The fan itself just may not provide any sort of metrics. I recommend you crack open the case, remove the fan carefully if necessary, and get any information off of it you can - like make, model, etc. See if you can find any hardware specs for it on the manufacturer's site before you start with low-level programming that 1) can be complicated, and 2) really isn't a job for .NET at this point. Sure, you could P/Invoke lots of APIs and define lots of structs and enums for interop, but 1) it would be specific to your fan (otherwise the Win32_Fan WMI class would probably give you what you need), and 2) may not work anyway because the fan itself doesn't provide metrics. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

              Y 1 Reply Last reply
              0
              • H Heath Stewart

                That may not help. The fan itself just may not provide any sort of metrics. I recommend you crack open the case, remove the fan carefully if necessary, and get any information off of it you can - like make, model, etc. See if you can find any hardware specs for it on the manufacturer's site before you start with low-level programming that 1) can be complicated, and 2) really isn't a job for .NET at this point. Sure, you could P/Invoke lots of APIs and define lots of structs and enums for interop, but 1) it would be specific to your fan (otherwise the Win32_Fan WMI class would probably give you what you need), and 2) may not work anyway because the fan itself doesn't provide metrics. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

                Y Offline
                Y Offline
                Yeast27
                wrote on last edited by
                #7

                Thank a lot for your help... Too bad that I am using a laptop and doesn't want to mess around with cracking it too much, I am really bad at assemble things back. Thank you,

                H 1 Reply Last reply
                0
                • Y Yeast27

                  Thank a lot for your help... Too bad that I am using a laptop and doesn't want to mess around with cracking it too much, I am really bad at assemble things back. Thank you,

                  H Offline
                  H Offline
                  Heath Stewart
                  wrote on last edited by
                  #8

                  Ah, if it's a laptop I wouldn't recommend it. Most desktops are easy to open, often times with just the click of a button. Sorry. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups