也谈不上.我见vb中有这样的代码.大家帮我看看<br><br>VB.Net 使用 WMI ( Windows Management Instrumentation ) 來取得 CPU 溫度<br><br> <br><br><< VB.Net >><br><br> <br><br>請先加入參考 System.Management<br><br> <br><br>Imports System<br><br>Imports System.Management<br><br> <br><br>Public Class Form1<br><br> <br><br> Private Sub Button1_Click(ByVal s As Object, ByVal e As EventArgs) Handles Button1.Click<br><br> <br><br> Dim CPUtprt As Integer = CPU_Temperature()<br><br> <br><br> If CPUtprt >= 100 Then<br><br> MessageBox.Show("CPU 溫度: " & CPUtprt.ToString & " °C" & ControlChars.CrLf & _<br><br>"溫度破錶嚕! 快準備煎蛋囉! " & ControlChars.CrLf & _<br><br>"或開啟自動灑水系統降溫喔!")<br><br> Else<br><br> MessageBox.Show("CPU 溫度: " & CPU_Temperature() & " °C")<br><br> End If<br><br> <br><br> End Sub<br><br> <br><br> ' 取得CPU 溫度<br><br> Private Function CPU_Temperature() As Integer<br><br> Dim Q As String = "Select * From MSAcpi_ThermalZoneTemperature"<br><br> Dim mos As New ManagementObjectSearcher("root/WMI", Q)<br><br> For Each mo As ManagementObject In mos.Get<br><br> Return Convert.ToInt32(mo.GetPropertyValue("CurrentTemperature") - 2732) / 10<br><br> Next<br><br> End Function<br><br> <br><br>End Class<br><br> <br><br><br><br> <br><br> <br><br>' ================================================================<br><br> <br><br> <br><br><< VB6 >><br><br> <br><br>Private Sub Command1_Click()<br><br> <br><br> MsgBox "CPU 溫度 : " & CPU_Temperature & " °C"<br><br> <br><br>End Sub<br><br> <br><br>Private Function CPU_Temperature() As Integer<br><br> <br><br> Dim WMIsvc As Object<br><br> Dim CltItems As Object, CltItem As Object<br><br> Dim Q As String