| ' 获取登录哪个邮箱
index=inputbox("0--yahoo "&vbcrlf&vbcrlf&"1--163","选择邮箱",0)
' 创建InternetExplorer.Application对象
Set ie = CreateObject("internetexplorer.application")
ie.Visible = 1 ' 设置网页的可见性
Select Case Index
Case "0" ' 当选择0--yahoo时
ie.navigate "http://cn.mail.yahoo.com/" ' 打开yahoo邮箱登录页
Wscript.Sleep 5000 ' 等待5秒,确保网页已打开完毕
ie.document.getElementById("login").Value = "username" ' 将id为login的表单填为username
ie.document.getElementById("passwd").Value = "密码"
Set ie = Nothing ' 释放对象占用的内存
Case "1" ' 第二个登录过程
ie.navigate "http://mail.163.com"
Wscript.Sleep 5000
ie.document.getElementById("login163").username.Value = "cfan"
ie.document.getElementById("login163").Password.Value = "cfan"
End Select
Set ie = Nothing ' 没选任何或超出范围时仍要释放对象
' 当把vbs放在加密的rar中,一定要用下面FSO对vbs进行删除操作, '以免账号泄漏在临时文件夹中
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.GetFile("login.vbs")
myFile.DeletE:set myfile=nothing:set fso=nothing |