以下为我写的自动登录Chinaren校友录的脚本:
'============================
On Error Resume Next
set Wshell=WScript.createobject("WScript.shell")
while(true)
'On Error Resume Next
set ie=WScript.createobject("internetexplorer.application")
ie.navigate " http://alumni.chinaren.com/class/class_index.jsp?classuuid=135876464987354687345"
ie.visible=true
do
Wscript.sleep 6000
loop until (ie.ReadyState=3 Or ie.ReadyState = 4)
Wscript.sleep 4000
Set txt =ie.Document.body.createTextRange()
If(txt.findText("本班成员登录才可查看")) then
ie.visible = true
in_name = ie.Document.getElementsByName("uid")
in_pass = ie.Document.getElementsByName("passwd")
in_name.value = "你的用户名"
in_pass.value = "你的密码"
Wscript.sleep 500
in_pass.focus()
wshell.sendkeys "~"
Wscript.sleep 1000
ie.visible = false
do
Wscript.sleep 3000
loop until (ie.ReadyState = 3 Or ie.ReadyState = 4)
End if
'if err.number then
' err.Clear
'end if
wscript.sleep 30000
'wshell.sendkeys"^w"
ie.quit()
wscript.sleep 1000*60*15
wend
'=======================================
将以上文字拷贝到文本文件中,然后将“ classuuid=135876464987354687345”中的“135876464987354687345”改为你班级主页的id,然后将“ 你的用户名”改为你的用户名,例如:xuwedo2001,将“你的密码”改为你的密码,例如:159753。保存,然后将文件的扩展名改为“.vbs”,例如:autoLoginChinaren.vbs,然后双击即可。
'============================
On Error Resume Next
set Wshell=WScript.createobject("WScript.shell")
while(true)
'On Error Resume Next
set ie=WScript.createobject("internetexplorer.application")
ie.navigate " http://alumni.chinaren.com/class/class_index.jsp?classuuid=135876464987354687345"
ie.visible=true
do
Wscript.sleep 6000
loop until (ie.ReadyState=3 Or ie.ReadyState = 4)
Wscript.sleep 4000
Set txt =ie.Document.body.createTextRange()
If(txt.findText("本班成员登录才可查看")) then
ie.visible = true
in_name = ie.Document.getElementsByName("uid")
in_pass = ie.Document.getElementsByName("passwd")
in_name.value = "你的用户名"
in_pass.value = "你的密码"
Wscript.sleep 500
in_pass.focus()
wshell.sendkeys "~"
Wscript.sleep 1000
ie.visible = false
do
Wscript.sleep 3000
loop until (ie.ReadyState = 3 Or ie.ReadyState = 4)
End if
'if err.number then
' err.Clear
'end if
wscript.sleep 30000
'wshell.sendkeys"^w"
ie.quit()
wscript.sleep 1000*60*15
wend
'=======================================
将以上文字拷贝到文本文件中,然后将“ classuuid=135876464987354687345”中的“135876464987354687345”改为你班级主页的id,然后将“ 你的用户名”改为你的用户名,例如:xuwedo2001,将“你的密码”改为你的密码,例如:159753。保存,然后将文件的扩展名改为“.vbs”,例如:autoLoginChinaren.vbs,然后双击即可。