w3Sockets is another free and practical ASP component developed by the famous JMAIL email component developer.
Friends who need to download can download it here:
After downloading
http://www.dimac.net/FreeDownloads/dlstart.asp?ProductID=2
, unzip it and run SocketReg.exe to register the component.This article mainly introduces how to use this component WHOIS domain name. Currently, many domain name query systems on the Internet obtain other web page data and records through XMLHTTP. In fact, we can completely implement the WHOIS function through w3Sockets ourselves.
The program code is as follows:
<% @ LANGUAGE=VBScript %>
<%
Dim Domain,socket
Domain = "knowsky" 'Here we take knowsky as an example
Set socket = Server.CreateObject( "Socket.TCP" ) 'Create socket object
function whois( Domain, Server )
socket.Host = Server + ":43" 'Set the host address
socket.Open() 'Open
socket.SendLine( Domain ) 'Pass variable
socket.WaitForDisconnect()
Response.Write( "<blockquote><pre>" + socket.Buffer + "</pre></blockquote>" ) ' Get content
socket.Close() 'Close
End Function
%>
<html>
<body bgcolor="#FFFFFF" text="#000010" link="#0000C0" vlink="#000040" alink="#000040">
<%Call whois( DomainName + ".com", "rs.internic. net" ) %>
<%Call whois( DomainName + ".net", "rs.internic.net" ) %>
<%Call whois( DomainName + ".org", "rs.internic.net" ) %>
</body>
</html>