闲的蛋疼今天~
电脑浏览器记住密码功能好蛋疼~有时候不好用~~登录CMCC-EDU的时候老是要输入帐号。。看了看登录页面的网页源码~~撸起个Vbs脚本~读取配置文件,简单实现了自己登录CMCC-EDU,把帐号存在同级目录下就好。一行帐号,一行密码。
好久不用vbs~都忘记了快~~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
'自动登录CMCC-EDU 'By:Seven 2014/2/25 On Error Resume Next Set WshShell = CreateObject( "wscript.Shell" ) Set fso = CreateObject( "scripting.filesystemobject" ) Set ie = CreateObject( "InternetExplorer.Application" ) Set list = fso.OpenTextFile( "帐号.txt" ) ie.Visible=1 ie.Navigate "www.baidu.com" Do Until ie.ReadyState =4 : WScript.Sleep 200 : Loop ie.document.getElementByIdx_x( "bpssUSERNAME" ).Value=List.ReadLine ie.document.getElementByIdx_x( "bpssBUSPWD" ).Value=List.ReadLine Set AllElement=ie.Document For i=0 To AllElement.all.length-1 if AllElement.all(i).tagname= "INPUT" Then if AllElement.all(i).value= "登录" Then AllElement.all(i).click End If End if Next |
效果图