Multi-domain name suffix under ASP query Domain Name query system _ Application Skills

Source: Internet
Author: User
It's easy to write, it's just a 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
' Get the remote page binary source code
Function getboy (URL)
' On Error Resume Next
Set objxml = Server.CreateObject ("Microsoft.XMLHTTP")
With Objxml
. Open "Get", Url,false, "", "" "
. Send
Getboy =. Responsebody
End With
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 name is as follows
<%
' Www.knowsky.com If a query is submitted
If Request.Form ("yes") <> "Then
Yes = replace (Request.Form ("yes"), "" "" ") ' remove spaces from a check box string
Yes = Split (yes, ",") instantiate an array yes, assign a Yes array separated by commas to Yes new array

For i = 0 To UBound (yes) ' traversal of the array loop begins
url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain=" &request.form ("Domain") & "&ext=" &yes (i)
wstr = Getboy (URL) ' Get the source code after the query
If InStr (WSTR, "unregistered domain name") <> 0 Then ' Determine if the domain name is already registered
Response.Write Request.Form ("Domain") & "." &formaturl (yes (i)) & "<br><br><br><br>" ' lists unregistered domain names
End If
Next
Response. Write "<p><p><p> registered domain name is:<br> as follows"
For i = 0 To UBound (yes) ' traversal of the array loop begins
url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain=" &request.form ("Domain") & "&ext=" &yes (i)
wstr = Getboy (URL) ' Get the source code after the query
If InStr (WSTR, "registered domain name") <> 0 Then ' Determine if the domain name is already registered
Response.Write Request.Form ("Domain") & "." &formaturl (yes (i)) & "<br><br><br><br>" ' lists 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= "Enquiry" >
</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.