我们今天不会花太多时间来谈论 HTA;如果您对此感兴趣,可以查找大约一年前我们针对该主题推出的网络广播。可以说,HTA 使我们能够将 Internet Explorer 和脚本代码结合在一起,并反过来为脚本提供图形用户界面。虽然还有一些方法可以将图形用户界面合并到脚本中,但是对于才开始涉足 GUI 开发的用户来说,这可能是最简单的方法。
If ComputerOption(0).Checked Then strComputer = ComputerOption(0).Value End If If ComputerOption(1).Checked Then strComputer = ComputerOption(1).Value End If If ComputerOption(2).Checked Then strComputer = ComputerOption(2).Value End If If ComputerOption(3).Checked Then strComputer = ComputerOption(3).Value End If
If strComputer = "" Then Exit Sub End If
Set objWMIService = GetObject _ ("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_OperatingSystem") For Each objItem in ColItems Msgbox objItem.Caption Next
If ComputerOption(0).Checked Then strComputer = ComputerOption(0).Value End If If ComputerOption(1).Checked Then strComputer = ComputerOption(1).Value End If If ComputerOption(2).Checked Then strComputer = ComputerOption(2).Value End If If ComputerOption(3).Checked Then strComputer = ComputerOption(3).Value End If
If strComputer = "" Then Exit Sub End If
Set objWMIService = GetObject _ ("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_OperatingSystem") For Each objItem in ColItems Msgbox objItem.Caption Next
If ComputerOption(0).Checked Then strComputer = ComputerOption(0).Value End If If ComputerOption(1).Checked Then strComputer = ComputerOption(1).Value End If If ComputerOption(2).Checked Then strComputer = ComputerOption(2).Value End If If ComputerOption(3).Checked Then strComputer = ComputerOption(3).Value End If
If strComputer = "" Then Exit Sub End If
Set objWMIService = GetObject _ ("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_Service") For Each objItem in ColItems strText = strText & objItem.Name & "<BR>" Next