我想像这样创建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服务器返回不同的答案,而且解析返回的答案是一项非常困难的任务。如何做到这一点?
发布于 2010-03-10 07:44:51
以下是一篇博客文章的链接,其中包含一些可能会有所帮助的C#代码:
http://blog.flipbit.co.uk/2009/06/querying-whois-server-data-with-c.html
您可能会在遇到无法获得所需数据的实例时调整解析代码,但我不认为有一个万能的解决方案。
发布于 2010-03-10 07:36:43
如果不为您遇到的每个whois数据库实现一个解析器,就不可能做到这一点。
Whois没有标准化的格式,大多数注册表甚至没有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
...https://stackoverflow.com/questions/2413431
复制相似问题