<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>
<TD colspan= "2" align= "center" ><strong> Domain name query system </strong></td>
</tr>
<tr>
<TD width= "align=" "right" valign= "middle" >www.
<input name= "DNS" type= "text" id= "DNS" >
</td>
<TD width= "><input type=" "Submit" name= "submit" value= "Query" ></td>
</tr>
<tr>
<TD height= "colspan=" "2" align= "Center" >
<table width= "80%" border= "0" >
<tr>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "checkbox" value= "com" checked>
. com </td>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "CN" >
. CN </td>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= ". NET Tutorials" >
.net</td>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "org" >
. org </td>
</tr>
<tr>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "com.cn" >
.com.cn</td>
<TD align= "left" ><input type= "checkbox" name= "ext" value= "net.cn" >
. net.cn </td>
<TD align= "left" ><input name= "ext" type= "checkbox" id= "ext" value= "org.cn" >
. org.cn </td>
<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
%>