[英]Parse whois answer
我想創建那樣的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服務器返回不同的答案,解析返回的答案是一項非常困難的任務。 如何才能做到這一點?
如果沒有為您遇到的每個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
...
這是一個博客文章的鏈接,其中包含一些可能有用的C#代碼:
http://blog.flipbit.co.uk/2009/06/querying-whois-server-data-with-c.html
您可能會調整解析代碼,因為您遇到了無法獲得所需數據的實例,但我認為沒有一個適合所有解決方案的鞋子。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.