我不确定为什么,但我的子功能不起作用。我以为我已经遵循了它应该如何工作,但它只会导致一个错误,声称我的函数未定义。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="x-ua-compatible" content="IE=edge">
<title>Remote Registry</title>
<HTA:APPLICATION
APPLICATIONNAME="Remote Registry"
ID="RemReg"
VERSION="1.0.0.0"
SCROLL="no"
SINGLEINSTANCE="yes"
CONTEXTMENU="no"
NAVIGABLE="yes"
SELECTION="no"
/>
<style type="text/css">
body
{
margin: 0;
width: 130px;
height: 180px;
overflow: hidden;
font-family: arial;
font-weight: bold;
font-size: 12px;
}
</style>
</head>
<SCRIPT LANGUAGE="VBScript">
Sub CheckService
strComputer = txtBox.value
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name=""RemoteRegistry""")
For Each objService in colRunningServices
Output = objService.DisplayName & " is " & objService.State
Next
End Sub
</script>
<body>
<input type="text" name="TxTbox" size="30" value=DTP-> Computer to check<br />
<input id=checkservice type="button" value="Add Button" onClick="CheckService">
<div id="strComputer"></div>
</body>
</html>
我错过了什么?真的很简单吗?我已经尝试了函数的替代名称,移动到 VBScript 所在的位置。没有任何效果:sRem