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>