is Domain name registration query (WHOIS) complicated--method two

Source: Internet
Author: User
Tags domain name registration server port visual studio
Voodoo published in 2000-06-03 22:42:07<%@ language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<form action=whois.asp method=post>
Domain name:www<b>.</b> <input size=8 name=domainname value= "<% =request" DomainName "". <select name=ext>
<option selected>com</option>
<OPTION>net</OPTION>
<OPTION>org</OPTION>
<OPTION>com.cn</OPTION> <OPTION>net.cn</OPTION> <OPTION>org.cn</OPTION>
</SELECT>
<input class=input1 type=submit value= domain name Query name=submit>
</form>

<%
Dim strresult
If Request.ServerVariables ("request_method") = "POST" THEN
Dim strquery
' Get the domain name you want to query
Strquery=request ("domainname") & "." & Request ("ext")

Dim Objsock
' Create a Sock object
Set objsock=server.createobject ("Aspsock.conn")
' Set the WHOIS server to Rs.internic.net
Select Case Request ("ext")
Case "com", "net", "org"
Objsock.remotehost= "Rs.internic.net"
Gj=0
Case "com.cn", "net.cn", "org.cn"
Objsock.remotehost= "drop.cnnic.net.cn"
Gj=1
End Select
' Set WHOIS server port to 43
objsock.port=43
' Set timeout of 60 seconds for operation
Objsock.timeout=60
' Open connection with RemoteHost, return true to success
If Objsock.open Then
' Send query Writeln for VBCRLF end (Strquery & VBCRLF)
Objsock.writeln strquery
' Read the return value with a maximum length of 65535
Strresult=objsock.readbytesasstring (65535)
' Close the connection
Objsock.close
' Print the query results, you can do something about it
' Response.Write ' <b> query results </b><br><textarea rows=10 cols=60> "& Strresult &" </ Textarea> "
Select Case
Case "0"
Str1=inter (Strresult)
Response.Write str1
Response.Write "<b> Query results </b><br><textarea rows=10 cols=60>" & Strresult & "</ Textarea> "
Case "1"
Str1=cnnic (Strresult)
Response.Write str1
Response.Write "<b> Query results </b><br><textarea rows=10 cols=60>" & Strresult & "</ Textarea> "
End Select
End If
Set objsock=nothing

End If

function Inter (str)
If InStr (str, "No match") =0 then
Response.Write "Your domain name has been registered. "
Else
Response.Write "Your domain name is not registered. "
End If
End Function

function Cnnic (str)
If InStr (str, "%") =0 Then
Response.Write "Your domain name has been registered. "
Else
Response.Write "Your domain name is not registered. "
End If
End Function
%>


</BODY>
</HTML>



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.