For i=0 To UBound(user)
Set http = CreateObject("Msxml2.ServerXMLHTTP")
If login(user(i),pass(i)) Then
code = getCode()
If Len(code) Then
Set o=getSpace(code)
If o.state Then
WScript.Echo user(i), "»ñµÃ¿Õ¼ä:", o.picked, ", »ñµÃÓê¶:", o.Exp, ", ×Ü¿Õ¼ä:", o.total_size
Else
WScript.Echo user(i), "Ò¡½±Ê§°Ü »òÕß ÒѾҡ¹ýÁË"
End If
Else
WScript.Echo user(i), "½ñÌìÒѾҡ¹ýÁË..."
End If
Else
WScript.Echo user(i), "µÇ¼ʧ°Ü£¡..."
End If
Set http = Nothing
Next
If autoExit Then WScript.Quit
WScript.Echo vbCrLf, "°´ÈÎÒâ¼üÍ˳ö..."
WScript.StdIn.ReadLine
Function HttpPost(ByVal url, ByVal data) 'POSTº¯Êý
With http
.open "POST", url, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send data
HttpPost = .responseText
End With
End Function
Function HttpGet(ByVal url) 'GETº¯Êý
With http
.open "GET", url, False
.send
HttpGet = .responseText
End With
End Function
Function login(user,password) 'µÇ¼º¯Êý
url="http://passport.115.com/?ac=login"
data="back=http%3A%2F%2Fwww.115.com&goto=http%3A%2F%2F115.com&login%5Baccount%5D=" & user & "&login%5Bpasswd%5D=" & password
login = Len(HttpPost(url,data))<99
End Function
Function getCode() '¶ÁÈ¡Ò¡½±Âë
Set reg = New RegExp
reg.IgnoreCase = True
reg.Global = True
reg.MultiLine = True
reg.Pattern = "Yao\('(.*)',\s*function"
html = HttpGet("http://115.com/?ct=index&ac=home")
If reg.Test(html) Then getCode=Trim(reg.Execute(html).Item(0).Submatches(0)) Else getCode=""
End Function
Function getSpace(code) 'Ò¡½±
url="http://115.com/?ct=ajax_user&ac=pick_space&token=" & code & "&_=" & Rnd
Set getSpace = ParseJson(HttpGet(url))
End Function
Function ParseJson(strJson) 'JSONÊý¾Ý½âÎö
Set htmlfile = CreateObject("htmlfile")
Set owindow = htmlfile.parentWindow
owindow.execScript "var json_obj = " & strJson, "JScript"
Set ParseJson = owindow.json_obj
End Function
Function CmdMode(ByVal title,ByVal color) 'ÃüÁîÐÐģʽÔËÐÐ
If LCase(Right(WScript.FullName,11)) = "wscript.exe" Then
With CreateObject("Wscript.Shell")
.Run "cmd /c title " & title & "&color " & color & "&Cscript //Nologo """ & WScript.ScriptFullName & """"
.Run "taskkill /f /im cmd.exe",0
End With
WScript.Quit
End If
End Function