刚才写代码测试了,发现你给出的这个网站是自动保存登录状态一段时间的,也就是说,只能上一个帐号,多个帐号不能同时上- Const ForReading = 1
-
- Dim fso,f,objIE
- Dim strPath,username,password,ary,strLine,i
-
- '把下面的路径改为你的文本路径
- strPath = "C:\UsernamePassword.txt"
-
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set f = fso.OpenTextFile(strPath,ForReading,False)
-
- Set objIE = CreateObject("InternetExplorer.Application")
- objIE.Visible = True
- objIE.Navigate "http://www.5151c.com/default.aspx"
-
- While Not f.AtEndOfLine
- strLine = f.ReadLine
-
- If strLine <> "" Then
-
- ary = Split(strLine," ",-1)
-
- username = ary(0)
- For i = 1 To UBound(ary)
- If ary(i) <> " " Then
- password = ary(i)
- End If
- Next
-
- With objIE
- .Navigate "http://www.5151c.com/default.aspx" ,,"_blank"
-
- Do While .Busy Or .ReadyState <> 4
- WScript.Sleep 300
- Loop
-
- .Document.getElementById("Login").UserAccount.value = username
- .Document.getElementById("Login").Password.value = password
-
- WScript.Sleep 100
-
- .Document.getElementById("Login").submit()
- End With
-
- WScript.Sleep 300
-
- End if
- Wend
-
- f.Close
-
- Set fso = Nothing
- Set f = Nothing
- Set objIE = Nothing
复制代码
|