Using the W3sockets component to implement the Domain name query function

Source: Internet
Author: User
Tags implement query set socket socket domain name
W3sockets is another free and useful ASP component developed by the famous JMail Mail component developer.
Friends who need to download here can download:
http://www.dimac.net/FreeDownloads/dlstart.asp?ProductID=2

Unzip after downloading, run SocketReg.exe registration component.

Here mainly describes how to use the component Whois domain name, the current online many domain name query system is through XMLHTTP access to other web data, and get records. In fact, we can fully implement the function of Whois by w3sockets ourselves.

The program code is as follows:


<% @ language=vbscript%>
<%
Dim Domain,socket
Domain = "Knowsky" ' here take Knowsky as an example
Set socket = Server.CreateObject ("socket.tcp") ' Creates a socket object

function whois (Domain, Server)
Socket. Host = Server + ": 43" ' Set the address
Socket. Open () opens

Socket. Sendline (Domain) ' Pass variables

Socket. Waitfordisconnect ()

Response.Write ("<blockquote><pre>" + socket. Buffer + "</pre></blockquote>") ' Get content
Socket. Close () ' Off

End Function
%>


<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>




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.