JJX original, reprint must indicate the source
To copy code, use the forum's "copy" feature to complete
Chinaasp's domain name query to sell 1000 yuan, netizens made comments, but was Lucot a sentence (you put him packaged into components to try?) ) was blocked back. Domain name registration query (WHOIS) is it really complicated?
Domain name registration query is mainly through the WHOIS server to complete, currently more commonly used is rs.internic.net, through it can query the various international domain name is registered. The port of whois is usually 43. Using Winsock, you can simply implement this function in ASP
Unlike the Php/jsp,winsock feature, ASP is not built in, so a third party Winsock component must be used.
Here The example uses the Serverobjects Aspsock, the code annotation is more detailed, everybody can lift a three
Aspsock is not free, need $49, if need free everyone can encapsulate Winsock control in VB6
or download from this address for free
Xceed Winsock Library v1.1
Ftp://ftp.xceedsoft.com/pub/xceedwsl.exe
The main page of this component is
http://www.xceedsoft.com/
Whois.asp
-------------------------------------------
<%@ 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>
</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
Objsock.remotehost= "Rs.internic.net"
' 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> "
End If
Set objsock=nothing
End If
%>
</BODY>
</HTML>
The use of Winsock can accomplish many things that ASP is not likely to accomplish, such as NetEase like real no refreshing chat room, we carefully study it