手机
当前位置:查字典教程网 >脚本专栏 >vbs >用vbs实现虚拟主机和域名查循的脚本
用vbs实现虚拟主机和域名查循的脚本
摘要:IfWScript.Arguments.Count1ThenWScript.Echo"Example:CScript"&WScript.Sc...

IfWScript.Arguments.Count<>1Then

WScript.Echo"Example:CScript"&WScript.ScriptName&"www.sohu.com"

WScript.Quit

EndIf

url="http://www.seologs.com/ip-domains.html?domainname="&WScript.Arguments(0)

SetoXMLHttpRequest=CreateObject("Msxml2.XMLHTTP")

oXMLHttpRequest.Open"GET",url,False,False

oXMLHttpRequest.Send

str=oXMLHttpRequest.ResponseText

ipos=instr(str,"<fontface="&Chr(34)&"arial"&Chr(34)&">")

ipend=instr(str,"<->")

str=mid(str,ipos+19,ipend-ipos-139)

str=Replace(str,"<b>","")

str=Replace(str,"</b>","")

str=Replace(str,"<small>","")

str=Replace(str,"</small>","")

str=Replace(str,"</font><fontface="&chr(34)&"arial"&chr(34)&"size="&chr(34)&"-1"&chr(34)&">","")

str=Replace(str,"Found","Found")

iposa=instr(str,"with")

iposb=InStr(str,"1)")

stra=mid(str,iposa,iposb-iposa)

str=replace(str,stra,"lcx")

str=replace(str,"lcx1)","<br>1)")

'wscript.echostr

SetoXMLHttpRequest=Nothing

SetobjExplorer=WScript.CreateObject("InternetExplorer.Application")

objExplorer.Navigate"about:blank"

objExplorer.ToolBar=0

objExplorer.StatusBar=0

objExplorer.Visible=1

objExplorer.height=600

objExplorer.width=500

objExplorer.left=400

objExplorer.resizable=0

objExplorer.Document.Body.InnerHTML=str

objExplorer.document.parentwindow.clipboardData.SetData"text",str

SetobjExplorer=nothing

========================正则:

msg="请输入你要查询的IP或域名:"

IP=Inputbox(msg,"域名查询","www.haiyangtop.net")

IfIP=""ThenIP="www.haiyangtop.net"

url="http://www.seologs.com/ip-domains.html?domainname="&IP&""

Body=getHTTPPage(url)

SetRe=NewRegExp

Re.Pattern="(<fontface=""arial"">[sS]+</font></td></tr></table>)"

SetMatches=Re.Execute(Body)

IfMatches.Count>0ThenBody=Matches(0).value

SetoXMLHttpRequest=Nothing

SetobjExplorer=WScript.CreateObject("InternetExplorer.Application")

objExplorer.Navigate"about:blank"

objExplorer.ToolBar=0

objExplorer.StatusBar=0

objExplorer.Visible=1

objExplorer.height=300

objExplorer.width=400

objExplorer.left=400

objExplorer.resizable=0

objExplorer.Document.Body.InnerHTML=IP&Body

'objExplorer.document.parentwindow.clipboardData.SetData"text",IP&Body

SetobjExplorer=nothing

'函数区

FunctiongetHTTPPage(Path)

t=GetBody(Path)

getHTTPPage=BytesToBstr(t,"GB2312")

EndFunction

FunctionGetBody(url)

OnErrorResumeNext

SetRetrieval=CreateObject("Microsoft.XMLHTTP")

WithRetrieval

.Open"Get",url,False,"",""

.Send

GetBody=.ResponseBody

EndWith

SetRetrieval=Nothing

EndFunction

FunctionBytesToBstr(Body,Cset)

Dimobjstream

Setobjstream=CreateObject("adodb.stream")

objstream.Type=1

objstream.Mode=3

objstream.Open

objstream.WriteBody

objstream.Position=0

objstream.Type=2

objstream.Charset=Cset

BytesToBstr=objstream.ReadText

objstream.Close

Setobjstream=Nothing

EndFunction

【用vbs实现虚拟主机和域名查循的脚本】相关文章:

用vbs判断一个日期是否在指定的时段内

用vbs实现获取电脑硬件信息的脚本_最新版第1/4页

用vbs实现取消隐藏文件夹中的所有文件

vbs实现压缩文件夹的脚本

用vbs实现不死帐号的代码

用vbs遍历文件并随机显示的脚本

用vbs实现修改dns的网关脚本

用vbs实现更改计算机的说明的代码

用vbs实现zip功能的脚本

用vbs实现读取文本文件的方法

精品推荐
分类导航