用vbs实现虚拟主机和域名查循的脚本
作者 佚名
来源 ASP编程
浏览
发布时间 2013-07-09
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,"<!---endloop--->") 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"">[\s\S]+</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 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: vbs版IP地理位置查询小偷下一篇: VBS破坏性应用代码
关于用vbs实现虚拟主机和域名查循的脚本的所有评论