Domain name query system for simultaneous query of multiple domain name suffixes under asp

Source: Internet
Author: User

Write is very simple, but implements the Function

<%
Function formaturl (yes)
If mid (yes, 5, 1) <> "then
Yes1 = left (yes, 3)
Yes2 = right (yes, cint (len (yes)-3)
Formaturl = yes1 & "." & yes2
Else
Formaturl = yes
End if
End Function
'The remote webpage Binary source code is obtained
Function getBoy (url)
'On error resume next
Set objXml = Server. CreateObject ("Microsoft. XmlHttp ")
With objXml
. Open "get", url, false ,"",""
. Send
GetBoy =. responsebody
End
GetBoy = BytesToBstr (GetBoy, "GB2312 ")
Set objXml = nothing
End function

'Process binary stream code
Function BytesToBstr (strBody, CodeBase)
Dim objStream
Set objStream = Server. CreateObject ("Adodb. Stream ")
ObjStream. Type = 1
ObjStream. Mode = 3
ObjStream. Open
ObjStream. Write strBody
ObjStream. Position = 0
ObjStream. Type = 2
ObjStream. Charset = CodeBase
BytesToBstr = objStream. ReadText
ObjStream. Close
Set objStream = nothing
End Function
%>
The unregistered domain names are as follows:
<%
'Www .knowsky.com
If Request. Form ("yes") <> "Then
Yes = replace (Request. Form ("yes"), "", "") 'removes spaces in the check box string
Yes = split (yes, ",") 'instantiate an array yes. The yes array separated by commas is assigned to the new yes array.

For I = 0 to ubound (yes) 'traversal array loop starts
Url = "http://panda.www.net.cn/cgi-bin/Check.cgi? Domain = "& Request. Form (" domain ") &" & ext = "& yes (I)
Wstr = getBoy (url) 'obtain the queried source code
If instr (wstr, "unregistered domain name") <> 0 then' determines whether it is a registered domain name
Response. write Request. form ("domain ")&". "& formaturl (yes (I) &" <br> "'list unregistered domain names
End If
Next
Response. Write "<p> the registered domain name is as follows: <br>"
For I = 0 to ubound (yes) 'traversal array loop starts
Url = "http://panda.www.net.cn/cgi-bin/Check.cgi? Domain = "& Request. Form (" domain ") &" & ext = "& yes (I)
Wstr = getBoy (url) 'obtain the queried source code
If instr (wstr, "registered domain name") <> 0 then' determines whether it is a registered domain name
Response. write Request. form ("domain ")&". "& formaturl (yes (I) &" <br> "'list registered domain names
End If
Next

Else

%>
<Form name = "form1" method = "post" action = "">
<P>
<Input name = "domain" type = "text" id = "domain">
<Input type = "submit" name = "Submit" value = "query">
</P>
<P>
<Input name = "yes" type = "checkbox" id = "yes" value = "com">
. Com
<Input name = "yes" type = "checkbox" id = "yes" value = "net">
. Net
<Input name = "yes" type = "checkbox" id = "yes" value = "org">
. Org </p>
<P>
<Input name = "yes" type = "checkbox" id = "yes" value = "comcn">
.Com.cn
<Input name = "yes" type = "checkbox" id = "yes" value = "netcn">
.Net.cn
<Input name = "yes" type = "checkbox" id = "yes" value = "orgcn">
Org.cn
<Input name = "yes" type = "checkbox" id = "yes" value = "govcn">
Gov.cn </p>
<P>
<Input name = "yes" type = "checkbox" id = "yes" value = "info">
. Info
<Input name = "yes" type = "checkbox" id = "yes" value = "biz">
. Biz
<Input name = "yes" type = "checkbox" id = "yes" value = "TV">
. TV
<Input name = "yes" type = "checkbox" id = "yes" value = "cc">
. Cc </p>
<P>
<Input name = "yes" type = "checkbox" id = "yes" value = "cn">
. Cn
<Input name = "yes" type = "checkbox" id = "yes" value = "name">
. Name </p>
</Form>
<%
End If
%>

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.