我想创建这样的whois类

public class DomainInfo
{

     public string NameServer {get;set;}        
     public string CreationDate {get;set;}
     public string UpdatedDate {get;set;} 
     public string ExpirationDate {get;set;}
     public string Status {get;set;}        
     public string RegistrantName {get;set;}
     public string RegistrantOrganization {get;set;}
     public string Registrantemail {get;set;}        
     public static DomainInfo Parse(string inputData)
  {
     ......
  }
}

但我有一些问题,因为不同的DNS服务器返回不同的答案,这是一个非常艰巨的任务解析返回的答案。如何才能做到这一点?

有帮助吗?

解决方案

下面是一个博客帖子的链接与一些C#代码,这可能有助于:

HTTP://博客.flipbit.co.uk / 2009/06 /查询的WHOIS-服务器的数据与 - c.html

您也许可以调整解析代码,你遇到了,你没有得到你需要的数据实例,但我不认为这是一个鞋适合所有的解决方案。

其他提示

它不能没有实现解析器你遇到的每个Whois数据库来完成。

域名注册没有标准化的格式,大多数登记处甚至没有所有的信息提供了域名注册,而是给你一个手柄,你可以检查通过HTTP,同时填写验证码:

$ whois google.no
% Kopibeskyttet, se http://www.norid.no/domenenavnbaser/whois/kopirett.html
% Rights restricted by copyright. See http://www.norid.no/domenenavnbaser/whois/kopirett.en.html

Domain Information

Domain Name................: google.no
Organization Handle........: GNA78O-NORID
Registrar Handle...........: REG466-NORID
Legal-c Handle.............: RH1355P-NORID
Tech-c Handle..............: JM722P-NORID
Zone-c Handle..............: JM722P-NORID
...
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top