关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。
想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。
4年前关闭。
Improve this question
我找到了很多解释如何以两个或三个字母格式获取国家/地区代码的主题,但没有任何内容适合我的任务。
我正在寻找一种方法来获取数组或其他东西中的所有顶级域。我知道 C# 中有 CultureInfo 类,但它可以列出国家/地区代码。它不包括通用 TLD,例如:“com”。 Here's the complete list of country codes I found .
最佳答案
所有顶级域名的权威列表:http://www.iana.org/domains/root/db
The Root Zone Database represents the delegation details of top-level domains, including gTLDs such as
.com
, and country-code TLDs such as.uk
.
您也可以将其作为 TXT 获取(更容易解析):http://data.iana.org/TLD/tlds-alpha-by-domain.txt
维基百科也列出了所有的顶级域名,但它当然不是权威的:List of Internet top-level domains
Mozilla 基金会维护着一个 Public Suffix List对于有效的顶级域,即可以直接注册名称的域(例如
.co.uk
而不是 .uk
): http://publicsuffix.org/
关于url - 所有顶级域的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14427817/