急急,VB怎样读取.htm文件中的文本框中的数据

来源:百度知道 编辑:UC知道 时间:2024/05/28 14:43:08

Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
objExplorer.Navigate "D:\script\pass.html"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 400
objExplorer.Height = 250
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
Do While (objExplorer.Document.All.OKClicked.Value = "")
Wscript.Sleep 250
Loop
strPassword = objExplorer.Document.All.PasswordBox.Value
objExplorer.Quit
'Wscript.Sleep 250
Wscript.Echo strPassword

这个是脚本程序你改一下就可以使用VB了下面是一个HTML的源文件
<SCRIPT language="VBScript">
<!--
Sub OKButton_OnClick
OkClicked.Value = 1
End Sub
'-->
</SCRIPT>
<BODY>
Please enter your password: <INPUT TYPE=password Name = "PasswordBox" size="20">