Function HttpGet(ByVal url)'读取网页
With CreateObject("Msxml2.XMLHTTP")
.open "GET", url, False
.send
HttpGet = .responseText
End With
End Function
Function getUsers(strHtml)'读取在线用户
Set re = New RegExp
re.Global = True
re.MultiLine = True
re.Pattern = "<a href=""(http://www.52pojie.cn/space-uid-\d+.html)"">([^<]+)</a>"
If re.Test(strHtml) Then
For Each x In re.Execute(strHtml)
If Not users.Exists(x.Submatches(1)) Then users.Add x.Submatches(1),x.Submatches(0)
Next
Else
WScript.Echo vbCrLf, "无法读取在线用户,请先用IE浏览器登录吾爱!", vbCrLf, vbCrLf, "登录时,记得勾选上 ""自动登录"" 哦!", vbCrLf, vbCrLf, "请按任意键退出. . ."
WScript.StdIn.ReadLine
WScript.Quit
End If
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