Sub Main Dim Result As Integer
Dim Temp as String
dim FileNumber as integer
Dim iPos as integer
Dim UserName as string
Dim pw as string
'Initially Recorded: 2003-12-22 17:07:58
'Script Name: Demo
StartBrowser "http://192.168.1.42", "WindowTag=WEBBrowser"
Window SetContext, "WindowTag=WEBBrowser", ""
Browser NewPage,"HTMLTitle=Dynaweb EPS 2003企业门户服务器",""'
FileNumber = FreeFile
//循环读取文件中数据,登陆
//自读形式 打开文件
Open "f:\user.txt" For Input As #FileNumber
Do While Not EOF(1)
// 读取数据,进行处理
Line Input #FileNumber, Temp
iPos = InStr(1,Temp," ")
//提取用户名
UserName = left(Temp,iPos-1)
//提取密码
pw = Right(Temp,len(Temp)-6)
//找到用户,密码文本框,填写用户名,密码
EditBox Click, "Name=username", "Coords=35,12"
Inputkeys UserName
EditBox Click, "Name=password", "Coords=15,8"
inputkeys pw
//提交数据,退出当前用户
PushButton Click, "Name=submit"
Browser NewPage,"HTMLTitle=Dynaweb EPS 2003企业门户服务器",""
HTMLImage Click, "Index=7", "Coords=11,7"
Loop
Close #FileNumber
//关闭IeWindow CloseWin, "", ""
End Sub |