EmailListPath "电子邮件列表文件路径"
UserVar currentPos = 1  "从第...个邮箱登陆"          //当前的邮件位置

//使用前需要对 EmailListPath 用户变量进行赋值
//
//例如:c:\EmailList.txt
//文件每一行的内容为:账号|密码
//比如:有一个邮箱地址为:aaabbccc@163.com
//密码为:123456
//aaabbccc|123456
//aaeedd|123456
//
//currentPos 表示要从第几个邮箱地址开始登陆
//默认为1

//取得邮箱地址个数
count =  GetTxtCount(EmailListPath)

Call Plugin.Msg.Tips("163邮箱自动登陆器已启动!" & "共有 " & count& " 个邮箱" )



//MessageBox EmailListPath

PID=Plugin.Web.Bind("wqm.exe") 

Rem 开始
Call Plugin.Web.Go("http://mail.163.com")

Delay 1000

//id:idInput  username
//id:pwdInput pwd
//tag:BUTTON&value:登 录 
email = lib.文件.读取指定行文本内容(EmailListPath,currentPos) 
 
Dim emailInfoArray
emailInfoArray = split(email, "|") 

userName = emailInfoArray(0)
pwd = emailInfoArray(1)

Call Plugin.Web.HtmlInput(userName, "id:idInput")

Call Plugin.Web.HtmlInput(pwd, "id:pwdInput")

Delay 500

Call Plugin.Msg.Tips("第 "& currentPos & " 个 账号:"& userName & ",共有 " & count& " 个邮箱" )

Call Plugin.Web.HtmlClick("tag:BUTTON&value:登 录")

//检查密码是否正确

Delay 5000
Do While 1= 1

	If left(plugin.web.geturl, 41 ) = "http://mail.163.com/errorpage/err_163.htm" then
		
		//删除
		Call lib.文件.删除指定行文本内容(EmailListPath,currentPos)
		Goto 开始
		
		//EndScript
	else
		Exit Do
	End If
	
	Delay 50
Loop


Do While 1= 1
    url = Plugin.Web.GetURL 
	If InStr(1, url , "js3/main.jsp", 1) > 1  then
		
		//MessageBox "hhhh"
		//id:lnkexit&frame:0
		Call Plugin.Web.HtmlClick("id:lnkexit&frame:0")
		
		Delay 1500
		
		currentPos = currentPos + 1
		
		
		If currentPos > count then 
			Call Plugin.Msg.Tips("登陆自动登击完成!共有:" & count & "个邮箱地址。脚本自动结束!" )
			EndScript
		End if
		
		
		Goto 开始
	End If
	
	Delay 500
Loop


EndScript