[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
记事本中的多个帐号和密码是什么格式的?比如:
username password

或者?
username
password
---学无止境---

TOP

刚才写代码测试了,发现你给出的这个网站是自动保存登录状态一段时间的,也就是说,只能上一个帐号,多个帐号不能同时上
  1. Const ForReading = 1
  2. Dim fso,f,objIE
  3. Dim strPath,username,password,ary,strLine,i
  4. '把下面的路径改为你的文本路径
  5. strPath = "C:\UsernamePassword.txt"
  6. Set fso = CreateObject("Scripting.FileSystemObject")
  7. Set f = fso.OpenTextFile(strPath,ForReading,False)
  8. Set objIE = CreateObject("InternetExplorer.Application")
  9. objIE.Visible = True
  10. objIE.Navigate "http://www.5151c.com/default.aspx"
  11. While Not f.AtEndOfLine
  12. strLine = f.ReadLine
  13. If strLine <> "" Then
  14. ary = Split(strLine," ",-1)
  15. username = ary(0)
  16. For i = 1 To UBound(ary)
  17. If ary(i) <> " " Then
  18. password = ary(i)
  19. End If
  20. Next
  21. With objIE
  22. .Navigate "http://www.5151c.com/default.aspx" ,,"_blank"
  23. Do While .Busy Or .ReadyState <> 4
  24.           WScript.Sleep 300
  25.          Loop
  26. .Document.getElementById("Login").UserAccount.value = username
  27. .Document.getElementById("Login").Password.value = password
  28. WScript.Sleep 100
  29. .Document.getElementById("Login").submit()
  30. End With
  31. WScript.Sleep 300
  32. End if
  33. Wend
  34. f.Close
  35. Set fso = Nothing
  36. Set f = Nothing
  37. Set objIE = Nothing
复制代码
---学无止境---

TOP

返回列表