Implementation of the Asp.net domain WHOIS function

Source: Internet
Author: User
Tags net domain

Some time ago, I spent a few nights working on an online tool site. New tools are not available recently. If you need any online tools, you can submit them,

I prefer to be a developer-related tool, and I am not interested in tools like online name checking.

Domain whois data mainly comes from a website that provides domain whois query, because the data queried by this site is more detailed than that of other website services, including the address and phone number of the domain name owner.

However, he does not allow the same IP address to be queried too many times. I never expected this solution.

MainCode:

Public actionresult domainwhois (string domain) {If (! String. isnullorwhitespace (domain) {try {var client = new WebClient (); client. encoding = system. text. utf8encoding. utf8; var html = client. downloadstring (New uri ("http://whois.elmundo.es/whois/cgi/whois.html? Q = "+ domain); var parser = new Parser (New lexer (HTML); var nodes = parser. extractallnodesthatmatch (New tagnamefilter ("TD"); For (VAR I = 0; I <nodes. count; I ++) {var tag = nodes [I] As ITAG; If (tag! = NULL & tag. getattribute ("bgcolor") = "# d0d0d0") {viewbag. result = tag. tohtml (); break ;}} catch {viewbag. result = resources. noresult ;}} return view ();}

The above Code uses the winista. htmlparser component to parse the received HTML code. I think it is very convenient for winista. htmlparser to steal data from any site.

Running result:

Demo: http://tools.susucms.com/Query/DomainWhois? Domain = susucms.com

Related Article

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.