请教,语句问题
Dim $temp = ""$objWMIService = ObjGet("winmgmts:\\.\root\WMI")
$colItems = $objWMIService.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature")
$temp = ""
For $objItem in $colItems
$temp &= "CurrentTemperature: " & ($objItem.CurrentTemperature - 2732) / 10 & "°C" & @LF
Next
ToolTip(StringTrimRight($temp,1),100,0)
$objWMIService = 0
if $temp>25°Cthen
msgbox (0,0,"温度高于25度")
请教下,上面那里错了,如何修改才能让它条件成立 Dim $temp = ""
$objWMIService = ObjGet("winmgmts:\\.\root\WMI")
$colItems = $objWMIService.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature")
$temp = ""
For $objItem in $colItems
$temp &= "CurrentTemperature: " & ($objItem.CurrentTemperature - 2732) / 10 & "°C" & @LF
Next
ToolTip(StringTrimRight($temp,1),100,0)
$objWMIService = 0
$digital = StringRegExp($temp,'\d+',1)
if $digital>25 Then msgbox (0,0,"温度高于25度")回复 1# qq451763407
字符串不好比较真实的大小,要转化为数字来比较。 呵呵,很像我哦。{:face (355):} if $temp>25°Cthen
{:face (356):} 多谢二楼,问题解决
页:
[1]