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