55 lines
1.1 KiB
HTML
55 lines
1.1 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>My First VBScript</TITLE>
|
|
<!--
|
|
********************************
|
|
* test1.htm *
|
|
* Simple demonstration of how *
|
|
* VBScript interacts with *
|
|
* intrinsic HTML Objects *
|
|
********************************
|
|
-->
|
|
|
|
<SCRIPT LANGUAGE="vbscript">
|
|
|
|
Sub btnMyButton_OnClick
|
|
MsgBox("hello there")
|
|
|
|
dim services
|
|
dim class
|
|
dim property
|
|
dim vartype
|
|
dim Locator
|
|
Text = "root"
|
|
Set services = nothing
|
|
Set Class = nothing
|
|
|
|
Set Locator = CreateObject("WBEMIDispatchLocator")
|
|
|
|
Locator.ConnectServer Text, "" , "", "", 0, VT_Null, nothing, services
|
|
services.GetObject "__win32provider", 0, nothing, Class, nothing
|
|
class.GetObjectText 0, property
|
|
|
|
MsgBox(Property)
|
|
myvar = Document.frmMyForm.txtMyText1.value
|
|
Document.frmMyForm.txtMyText2.value = myvar
|
|
End Sub
|
|
|
|
</SCRIPT>
|
|
|
|
</HEAD>
|
|
|
|
<BODY BGCOLOR="#FFFFFF">
|
|
<CENTER>
|
|
<H1>TESTING</H1>
|
|
<FORM NAME="frmMyForm">
|
|
<INPUT type="text" name="txtMyText1" value="Hello World">
|
|
<p>
|
|
<INPUT type="text" name="txtMyText2">
|
|
<INPUT type="button" name="btnMyButton" value="Click Me!">
|
|
</FORM>
|
|
</CENTER>
|
|
|
|
</BODY>
|
|
|
|
<HTML> |