ASP code sharing with IP reverse lookup domain name

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

In many sites looking for a long time, and finally in an English station can be seen through the live.com search results extracted such information, so wrote the following paragraph: The program is only test success, did not optimize, query efficiency a bit low!

<%
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 the 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
        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
%>

From: Www.cnwebmaster.info Demo: http://www.cnwebmaster.info/tool/tip.asp (Temporary demo address)

Hint "website comprehensive information Inquiry tool" I am developing! Then you only need to enter a domain name will get a lot of information about this domain name! Do not need to be like some websites, check a thing to enter many times!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.