我們今天不會花太多時間來談論 HTA;如果您對此感興趣,可以查找大約一年前我們針對該主題推出的網絡廣播??梢哉f,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