ASP query domain name is registered

Source: Internet
Author: User

<title>asp query whether the domain name is registered </title>
<style>
Body TD {
font-size:12px;
}
</style>
<body>

<table width= "height=" 126 "border=" 0 "align=" center "cellpadding=" 0 "cellspacing=" 0 ">
<form name= "Form1" method= "Post" action= "Search.asp Tutorial" >
<tr>
&LT;TD colspan= "2" align= "center" ><strong> Domain name query system </strong></td>
</tr>
<tr>
&LT;TD width= "align=" "right" valign= "middle" >www.
<input name= "DNS" type= "text" id= "DNS" >
&nbsp;</td>
&LT;TD width= "><input type=" "Submit" name= "submit" value= "Query" ></td>
</tr>
<tr>
&LT;TD height= "colspan=" "2" align= "Center" >
<table width= "80%" border= "0" >
<tr>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "checkbox" value= "com" checked>
. com </td>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "CN" >
. CN </td>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= ". NET Tutorials" >
.net</td>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "org" >
. org </td>
</tr>
<tr>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "com.cn" >
.com.cn</td>
&LT;TD align= "left" ><input type= "checkbox" name= "ext" value= "net.cn" >
. net.cn </td>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "org.cn" >
. org.cn </td>
&LT;TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "gov.cn" >
. gov.cn </td>
</tr>
</table></td>
</tr>
</form>
</table>
</body>

Search.asp File Code

<%
On Error Resume Next
server.scripttimeout=9999999
Function Gethttppage (Path)
t = GetBody (Path)
Gethttppage=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
%>
<%
'''''''''''''''''''''''''''''''''''''
' Function: Query whether the domain name is registered
' Website: http://www.111cn.net
' Article for the author original, reproduced please indicate the origin of the article
' Keep The author information, thank you for your support!
'''''''''''''''''''''''''''''''''''''
Dns=request ("DNS")
Ext=request ("ext")

E=split (ext, ",")
For I=0 to UBound (e)
Edns=dns & "." & Trim (E (i))
Url= "http://www.checkdomain.com/cgi-bin/checkdomain.pl?domain=" &edns
Wstr=gethttppage (URL)
If InStr (LCase (WSTR), "registered") >0 Then
Response.Write Edns & ": Registered <br>"
Else
Response.Write Edns & ": Can register <br>"
End If
Next
%>

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.