Hey guys I think 3rd party tools can read the temperature in my pc, but can VB read the heat sensors in my pc?
Thanks!
Printable View
Hey guys I think 3rd party tools can read the temperature in my pc, but can VB read the heat sensors in my pc?
Thanks!
I don't know the answer to your question, but this link may get you started in a positive direction.
here is some code i used to get the cpu temperature
note, this will only work with some motherboards if they support this temperature setup, also i could not verify if the result was actually correct,vb Code:
Dim wbemServices As Object Dim wbemObject As Object Dim wbemObjectSet As Object Dim wbemCounter As Integer Dim stemp As Long Set wbemServices = GetObject("winmgmts:" & "\\localhost\root\wmi") Set wbemObjectSet = wbemServices.InstancesOf("MSAcpi_ThermalZoneTemperature") For Each wbemObject In wbemObjectSet stemp = (wbemObject.CurrentTemperature - 2732) / 10 Next
ok, but would I get the tempoerature into my label1?
label1 = stemp
lol Thank you, now this may be a dumb Q, but is this temp in C or f?
No expert on CPU temperatures, but I would say if it is under about 45 then it is in celcius. (To me 45 would be an extreme upper boundary (basically on fire :bigyello: ))
The clue is in westconn1's code. It looks as if the 'raw' temperature returned is tenths of degrees K.
(Current temp - 2732) / 10 will convert it to degrees C
I'm using Vista 32-bit, the code returns "automation error" on this line
VB Code:
For Each wbemObject In wbemObjectSet
my guess would be that wbemobjectset had returned nothing
Same thing here, I turned User Account Control off, re-booted and it seems to work ok now.