当前位置:首页 > 网络编程 > 新手教程 > > 同IP反向查找域名的ASP代码分享

同IP反向查找域名的ASP代码分享

点击次数:73 次 发布日期:2008-11-16 09:59:12 作者:源代码网
源代码网推荐

源代码网整理以下         在很多网站上找了半天,最后在一个英文站上看见可以通过live.com的搜索结果提取此类信息,于是写了下面一段:程序只是测试成功,没有进行优化,查询效率有点低!

源代码网整理以下        <%
        Dim strPage
        Function GetPage2(Path)
        t = GetBody(Path)
        GetPage2=BytesToBstr(t,"GB2312")
        End function

源代码网整理以下        Function GetBody(url)
        on error resume next
        Set Retrieval = CreateObject("Microsoft.XMLHTTP")
        With Retrieval
        .Open "Get", url, False, "", ""
        .Send
        GetBody = .ResponseBody
        End With
        Set Retrieval = Nothing
        End Function

源代码网整理以下        Function BytesToBstr(body,Cset)
        dim objstream
        set objstream = Server.CreateObject("adodb.stream")
        objstream.Type = 1
        objstream.Mode =3
        objstream.Open
        objstream.Write body
        objstream.Position = 0
        objstream.Type = 2
        objstream.Charset = Cset
        BytesToBstr = objstream.ReadText
        objstream.Close
        set objstream = nothing
        End Function

源代码网整理以下        Public Function GetDomain(TempStr,matchstr)
        set reg=new Regexp
        reg.Multiline=True
        reg.Global=True
        reg.IgnoreCase=true
        reg.Pattern=matchstr
        Set matches = reg.execute(TempStr)
        For Each match in matches
        if not instr(GetDomain,match.Value)>0 then
        GetDomain=GetDomain&match.Value
        end if
        Next
        End Function

源代码网整理以下        dim i
        for i=1 to 15
        strPage=strPage&GetPage2(" http://cnweb.search.live.com/results.aspx?q=ip%3A59.54.54.167&first="&i&"1")
        next
        strPage=GetDomain(strPage,"<cite>(.*?)/")
        strPage=replace(strPage,"<cite>","<li class=classli>")
        strPage=replace(strPage,"</","</")
        strPage=replace(strPage,"/","</li>")
        strPage=replace(strPage,"<<","<")
        strPage=GetDomain(strPage,"<li(.*?)/li>")

源代码网整理以下         response.write strPage
        %>

源代码网整理以下  来自:www.cnwebmaster.info演示:http://www.cnwebmaster.info/tool/tip.asp(临时演示地址)

源代码网整理以下  提示“网站综合信息查询工具”本人正在开发!届时你只需要输入一个域名将得到很多有关于这个域名的信息!不需要象有些网站一样,查个东西需要输入很多次!

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华