了解 URI, URL, and URN

url-300x197

  • URI:Uniform Resource Identifier,统一资源标识符;(RFC 3986)
  • URL:Uniform Resource Locator,统一资源定位符;(RFC 1738
  • URN:Uniform Resource Name,统一资源名称。(RFC 1737

URI可被视为定位符(URL),名称(URN)或两者兼备。统一资源名(URN)如同一个人的名称,而统一资源定位符(URL)代表一个人的住址。换言之,URN定义某事物的身份,而URL提供查找该事物的方法。

用于标识唯一书目的ISBN系统是一个典型的 URN 使用范例。例如,ISBN 0-486-27557-4(urn:isbn:0-486-27557-4)无二义性地标识出莎士比亚的戏剧《罗密欧与朱丽叶》的某一特定版本。

为获得该资源并阅读该书,人们需要它的位置,也就是一个 URL 地址。在类Unix操作系统中,一个典型的URL地址可能是一个文件目录,例如file:///home/username/RomeoAndJuliet.pdf。该URL标识出存储于本地硬盘中的电子书文件。因此,URL和URN有着互补的作用。

URL方案分类图。URL(定位符)和URN(名称)方案属于URI的子类,URI可以为URL或URN两者之一或同时是URI和URN。技术上讲,URL和URN属于资源ID;但是,人们往往无法将某种方案归类于两者中的某一个:所有的URI都可被作为名称看待,而某些方案同时体现了两者中的不同部分。


URI 标准

RFC3986,即“Uniform Resource Identifier (URI):Generic Syntax”,是一个 Internet Standard。 Request for Comments (RFC) 系列是著名的档案式文档系列,该系列构成了 Internet Engineering Task Force (IETF) 标准过程的主干。 在数以千计的 RFC 中,只有很少的部分,比如   TCP (RFC793) 以及 Internet Mail 格式 (RFC821) 和协议 (RFC822), 提高了整个 Internet Standard 的发展水平。 RFC3986 在  2005 年 1 月也提高了这个水平。

按照 URI 标准,上面的第一个例子 —— http://www.cisco.com/en/US/partners/index.html —— 实际上是一个 URI,并且它由以下几个组成部分:

th

  • 方案名 (http)

url(uniformresourcelocator)

  • 域名 (www.cisco.com)
  • 路径 (/en/US/partners/index.html)

thCA1OQ0FA

IETF 达成共识,共同管理该方案。Official IANA Registry of URI Schemes(请参阅 参考资料)中包括一些大家所熟悉的方案,如 httphttpsmailto,还有其他许多您可能熟悉或不熟悉的方案。

URI 路径像一个典型的文件路径名。URI 按照 UNIX® 的惯例采用了正下划线 (a/b/c),因为在 20 世纪 80 年代后期设计 URI 的时候, 在 Internet 上, UNIX 文化比 PC 文化更流行。正是那个时候,出现了几个用于访问远程文件的流行表示法。其中一个是 Ange-ftp, 它是用来编辑远程文件的 emacs 的一个扩展。它用路径名将主机名和用户名结合起来,以获取像/jbrown@freddie.ucla.edu:~mblack/这样的结果。为了跨机器进行命名,为 Web 开发的 URI 语法(按照非标准的 Apollo Domain UNIX)使用了双下划线符号,但是它也引入了方案语法,这样,来自许多不同协议的命名约定得到了统一。其中的一些例子有:

  • mailto:mbox@domain
  • ftp://host/file
  • http://domain/path

这里介绍的第二个例子是 www.yahoo.com/sports,它不是一个真正的 URI。 它是对 http://www.yahoo.com/sports 的一种方便的简写,是一种受流行的 Web 浏览器用户界面  (UI) 支持的格式。然而,不要再犯在 XSLT 中遗漏方案这样的错误,如下所示:

<xsl:include href="exslt.org/math/min/math.min.template.xsl" />

因为它将不会按照您期望的那样工作,除非您真的 在 XSLT 样式表之后引用 exslt.org 目录中的一个文件。XSLT 的 href 属性采用了一个 URI 引用,它可能是绝对引用,也可能是相对引用。以一个方案和一个冒号开始的 URI 引用是绝对引用;否则,该引用就是相对引用。相对的 URI 引用更像一个文件路径。例如,../noarch/config.xsd 也是一个相对的 URI 引用。

国际化的资源标志符

HTML 中的 href 属性采用了 URI 引用,这样讲有些过于简单。URI 和 URI 引用都是从有限的 ASCII 字符集合中得出的,并且 HTML 比它们更加国际化。事实上,对遵循 RFC3986 的注释的请求是符合 RFC3987 标准,即 Internationalized Resource Identifiers (IRI) 标准(请参阅 参考资料)。此规范在 IETF 标准化过程中没有它的前辈走的远,但是技术本身已是相当成熟,并被广泛部署。除了能够使用所有 Unicode 字符,而不是仅仅能够使用 ASCII 字符之外,IRI 和 URI 是完全一样的。像 URI一样,每个 IRI 都有一个相应的编码,以防需要在只接受 URI 的协议(比如 HTTP)中使用 IRI。

用 xml:base 重写基本 URI

通常, URI 引用与在哪种文档中发现它有关。如果使用基本 URI http://exslt.org/math/min/math.min.template.xsl 查看一个文档,并看到了一个 URI 引用 ../../random/random.xml,那么引用将扩展为 http://exslt.org/random/random.xml。在 HTML 中,您可以把一个 base 元素放在文档顶端来重写基本 URI。XML Base 规范(请参阅 参考资料)在 XML 中也提供了同样的功能。

考虑一个既可以用 file:/my/doc 访问也可以用 http://my.domain/doc 访问的文档。通常,当通过文件系统访问文档时,您可能希望这些引用像 #part2 那样扩展为 file:/my/doc#part2;而通过 HTTP 访问文档时,您可能希望 #part2 扩展为 http://my.domain/doc#part2。但是在 Resource Description Framework (RDF) 模式中,为了使一些组件正常工作,展开的形式必须保持不变。 XML Base 使这种扩展变得容易(参见清单 1)。

清单 1. RDF 中的展开形式

				
<rdf:RDF
  xmlns="&owl;"
  xmlns:owl="&owl;"
  xml:base="http://www.w3.org/2002/07/owl"
  xmlns:rdf="&rdf;"
  xmlns:rdfs="&rdfs;"
>
...
    <Class rdf:about="#Nothing"/>

在这个例子中,无论您是在哪里找到的那个文件,#Nothing 引用均被扩展为 http://www.w3.org/2002/07/owl#Nothing

好了,关于 URI、IRI 和 URI 引用的介绍就到此结束了。

URL 和 URN

设计 URI 的目的是让它起到名称和定位器的作用。当 IETF 用它们实现标准化的时候,它们就成了通常所说的 Uniform Resource Locators,并且另一项关于 Uniform Resource Names 的独立的工作也已经开始了。

对于 Internet 主机,名称和位置都有单独的标准。主机名和域名有相同的语法(例如,zork1.example.edu)。这些主机名通过 Domain Name System (DNS) 协议和类似 192.168.300.21 的地址相连。当主机改变了在网络中的位置或重新编号之后,这种间接的做法允许主机保留其名称。

Web 中偶尔中断的链接使 Web 地址从外观上看更像是一个位置,而不是一个名称,并且在 IEIF 社区中也出现了不同的观点:

  • URI:RFC1630,发布于 1994 年 6 月,被称为“Universal Resource Identifiers in WWW: A Unifying Syntax for the Expression of Names and Addresses of Objects on the Network as used in the World-Wide Web”(请参阅 参考资料)。它是一个Informational RFC  —— 也就是说,它没有获得社区的任何认可。
  • URL:RFC1738,发布于 1994 年 12 月, 被称为“Uniform Resource Locators”(请参阅 参考资料)。它是一个 Proposed Standard —— 也就是说,它是一个共识过程的结果,虽然它还没有经过测试,并成熟到足以成为一个完整的 Internet Standard。
  • URN:RFC1737,发布于 1994 年 12 月,被称为“Functional Requirements for Uniform Resource Names”(请参阅 参考资料)。

1997 年,紧随 Proposed Standard RFC2141(即 URN Syntax)之后发布了 RFC1737,它指定了另一个方案 —— urn: —— 来加入 http:ftp:和其他协议中。

最终的 URI Standard (RFC3986) 在 1.1.3 小节“URI, URL, and URN”中澄清了这一区别:

URI 可以进一步分为定位器、名称,或者二者兼具。术语“Uniform Resource Locator” (URL) 涉及的是 URI 的子集,除识别资源外,它还通过描述其最初访问机制(比如它的网络“位置”)来提供定位资源的方法。 术语“Uniform Resource Name” (URN) 在历史上曾用于引用“urn”方案 [RFC2141] 下的 URI,这个 URI 需要是全球惟一的,并且在资源不存在或不再可用时依然保持不变,对于其他任何拥有名称的一些属性的 URI,都需要使用这样的 URI。

对于单独的方案,没有必要将其分为仅仅是一个 “名称”或者是一个“定位器”。 来自任意特定方案的 URI 实例可能有名称或定位器的特征,或两者兼而有之, 这通常取决于标识符分配中的持久性和命名机构对其关注程度, 而不取决于其他方案的质量。未来的规范和相关的文档应当使用通用术语“URI”,而不是使用有更多限制的条目“URL”和“URN” [RFC3305]。

http://www.ibm.com/developerworks/cn/xml/x-urlni.html

 

附录(梳理归类):

其中,URL,URN是URI的子集,其区别如下: Web上地址的基本形式是URI,它代表统一资源标识符,有两种形式: URL:目前URI的最普遍形式就是无处不在的URL或统一资源定位器。 URN:URL的一种更新形式,统一资源名称(URN, Uniform Resource Name)不依赖于位置,并且有可能减少失效连接的个数。但是其流行还需假以时日,因为它需要更精密软件的支持。

参考:http://www.cnlei.org/blog/article.asp?id=356

URN 站点 : http://purl.org/ | http://www.doi.org/demos.html

 

[文章部分内容引用地址] :

http://blog.sina.com.cn/s/blog_5c4a1a800100gxke.html

[分清 URI、URL 和 URN] http://www.ibm.com/developerworks/cn/xml/x-urlni.html

 

P.S. :  http://,https://,mms://,ftp://,rtsp://,ssl://,sftp://,pnm://,rtmp://等协议, 又如 thunder迅雷 , flashget快车 &&QQ旋风等.

thunder://类似的协议是base64编码加密。

 

Special-Use Domain Names

  • Created

2012-07-06

  • Last Updated

2013-02-21

Special-Use Domain Names

Registration Procedure(s)
Standards Action and IESG Approval
Reference
[RFC6761]
Note
The "Special Use" designation applies to both the listed domains and their subdomains.
Alternative Formats
CSV      Plain text
Name Reference
10.in-addr.arpa. [RFC6761]
16.172.in-addr.arpa. [RFC6761]
17.172.in-addr.arpa. [RFC6761]
18.172.in-addr.arpa. [RFC6761]
19.172.in-addr.arpa. [RFC6761]
20.172.in-addr.arpa. [RFC6761]
21.172.in-addr.arpa. [RFC6761]
22.172.in-addr.arpa. [RFC6761]
23.172.in-addr.arpa. [RFC6761]
24.172.in-addr.arpa. [RFC6761]
25.172.in-addr.arpa. [RFC6761]
26.172.in-addr.arpa. [RFC6761]
27.172.in-addr.arpa. [RFC6761]
28.172.in-addr.arpa. [RFC6761]
29.172.in-addr.arpa. [RFC6761]
30.172.in-addr.arpa. [RFC6761]
31.172.in-addr.arpa. [RFC6761]
168.192.in-addr.arpa. [RFC6761]
254.169.in-addr.arpa. [RFC6762]
8.e.f.ip6.arpa. [RFC6762]
9.e.f.ip6.arpa. [RFC6762]
a.e.f.ip6.arpa. [RFC6762]
b.e.f.ip6.arpa. [RFC6762]
example. [RFC6761]
example.com. [RFC6761]
example.net. [RFC6761]
example.org. [RFC6761]
invalid. [RFC6761]
local. [RFC6762]
localhost. [RFC6761]
test. [RFC6761]

文件大小换算

1 Mio file = 1 mebioctet* = 220 octets = 1,024 Kio = 1,048,576 octets
10 Mio file = 10 mebioctet = 10 x 220 octets = 10,240 Kio = 10,485,760 octets
100 Mio file = 100 mebioctet = 100 x 220 octets = 102,400 Kio = 104,857,600 octets
1 Gio file = 1 gibioctet = 230 octets = 1,024 Mio = 1,073,741,824 octets
10 Gio file = 10 gibioctet = 10 x 230 octets = 10,240 Mio = 10,737,418,240 octets

1 Mbit file = 1 megabit = 106 bits = 1,000 kbit = 1,000,000 bits
10 Mbit file = 10 megabit = 107 bits = 10,000 kbit = 10,000,000 bits
100 Mbit file = 100 megabit = 108 bits = 100,000 kbit = 100,000,000 bits
1 Gbit file = 1 gigabit = 109 bits = 1,000 Mbit = 1,000,000,000 bits
10 Gbit file = 10 gigabit = 1010 bits = 10,000 Mbit = 10,000,000,000 bits

 

国际化域名IDN (Internationalized Domain Names) 转换

将域名国际化 IDN (internationalized domain name) 标准编码的域名标签的子字符串解码为一个 Unicode 字符串(Punycode). 或者将一个国际化域名字符串(Punycode )转换为符合 IDN 标准的域名
例:
Bücher.ch --> xn--bcher-kva.ch |
новини.com --> xn--b1amarcd.com |
统计局.中国 --> xn--dgtp91f7xi.xn--fiqs8s |
xn--j6w193g.xn--fiqs8s --> 香港.中国

代码段:

IDNA  >> Punycode

IdnMapping idn = new IdnMapping();
string international = idn.GetAscii(yourDomain, 0, yourDomain.Length);

Punycode  >> IDNA

>IdnMapping idn = new IdnMapping();
string nonInternational = idn.GetUnicode(yourDomain, 0, yourDomain.Length);

 

下载文件 : IDN Converter

 

IANA IPv4 地址空间注册表

IANA IPv4 Address Space Registry

Last Updated
2013-03-22
Description
The allocation of Internet Protocol version 4 (IPv4) address space to various registries is listed
here. Originally, all the IPv4 address spaces was managed directly by the IANA. Later parts of the
address space were allocated to various other registries to manage for particular purposes or
regional areas of the world. RFC 1466 [RFC1466] documents most of these allocations.

This registry is also available in plain text.

Prefix Designation Date Whois Status [1] Note
000/8 IANA – Local Identification 1981-09 RESERVED [2]
001/8 APNIC 2010-01 whois.apnic.net ALLOCATED
002/8 RIPE NCC 2009-09 whois.ripe.net ALLOCATED
003/8 General Electric Company 1994-05 LEGACY
004/8 Level 3 Communications, Inc. 1992-12 LEGACY
005/8 RIPE NCC 2010-11 whois.ripe.net ALLOCATED
006/8 Army Information Systems Center 1994-02 LEGACY
007/8 Administered by ARIN 1995-04 whois.arin.net LEGACY
008/8 Level 3 Communications, Inc. 1992-12 LEGACY
009/8 IBM 1992-08 LEGACY
010/8 IANA – Private Use 1995-06 RESERVED [3]
011/8 DoD Intel Information Systems 1993-05 LEGACY
012/8 AT&T Bell Laboratories 1995-06 LEGACY
013/8 Xerox Corporation 1991-09 LEGACY
014/8 APNIC 2010-04 whois.apnic.net ALLOCATED [4]
015/8 Hewlett-Packard Company 1994-07 LEGACY
016/8 Digital Equipment Corporation 1994-11 LEGACY
017/8 Apple Computer Inc. 1992-07 LEGACY
018/8 MIT 1994-01 LEGACY
019/8 Ford Motor Company 1995-05 LEGACY
020/8 Computer Sciences Corporation 1994-10 LEGACY
021/8 DDN-RVN 1991-07 LEGACY
022/8 Defense Information Systems Agency 1993-05 LEGACY
023/8 ARIN 2010-11 whois.arin.net ALLOCATED
024/8 ARIN 2001-05 whois.arin.net ALLOCATED
025/8 UK Ministry of Defence 1995-01 whois.ripe.net LEGACY
026/8 Defense Information Systems Agency 1995-05 LEGACY
027/8 APNIC 2010-01 whois.apnic.net ALLOCATED
028/8 DSI-North 1992-07 LEGACY
029/8 Defense Information Systems Agency 1991-07 LEGACY
030/8 Defense Information Systems Agency 1991-07 LEGACY
031/8 RIPE NCC 2010-05 whois.ripe.net ALLOCATED
032/8 AT&T Global Network Services 1994-06 LEGACY
033/8 DLA Systems Automation Center 1991-01 LEGACY
034/8 Halliburton Company 1993-03 LEGACY
035/8 Administered by ARIN 1994-04 whois.arin.net LEGACY
036/8 APNIC 2010-10 whois.apnic.net ALLOCATED
037/8 RIPE NCC 2010-11 whois.ripe.net ALLOCATED
038/8 PSINet, Inc. 1994-09 LEGACY
039/8 APNIC 2011-01 whois.apnic.net ALLOCATED
040/8 Administered by ARIN 1994-06 whois.arin.net LEGACY
041/8 AFRINIC 2005-04 whois.afrinic.net ALLOCATED
042/8 APNIC 2010-10 whois.apnic.net ALLOCATED
043/8 Administered by APNIC 1991-01 whois.apnic.net LEGACY
044/8 Amateur Radio Digital Communications 1992-07 LEGACY
045/8 Administered by ARIN 1995-01 whois.arin.net LEGACY
046/8 RIPE NCC 2009-09 whois.ripe.net ALLOCATED
047/8 Administered by ARIN 1991-01 whois.arin.net LEGACY
048/8 Prudential Securities Inc. 1995-05 LEGACY
049/8 APNIC 2010-08 whois.apnic.net ALLOCATED
050/8 ARIN 2010-02 whois.arin.net ALLOCATED
051/8 UK Government Department for Work and Pensions 1994-08 whois.ripe.net LEGACY
052/8 E.I. duPont de Nemours and Co., Inc. 1991-12 LEGACY
053/8 Cap Debis CCS 1993-10 LEGACY
054/8 Administered by ARIN 1992-03 whois.arin.net LEGACY
055/8 DoD Network Information Center 1995-04 LEGACY
056/8 US Postal Service 1994-06 LEGACY
057/8 SITA 1995-05 LEGACY
058/8 APNIC 2004-04 whois.apnic.net ALLOCATED
059/8 APNIC 2004-04 whois.apnic.net ALLOCATED
060/8 APNIC 2003-04 whois.apnic.net ALLOCATED
061/8 APNIC 1997-04 whois.apnic.net ALLOCATED
062/8 RIPE NCC 1997-04 whois.ripe.net ALLOCATED
063/8 ARIN 1997-04 whois.arin.net ALLOCATED
064/8 ARIN 1999-07 whois.arin.net ALLOCATED
065/8 ARIN 2000-07 whois.arin.net ALLOCATED
066/8 ARIN 2000-07 whois.arin.net ALLOCATED
067/8 ARIN 2001-05 whois.arin.net ALLOCATED
068/8 ARIN 2001-06 whois.arin.net ALLOCATED
069/8 ARIN 2002-08 whois.arin.net ALLOCATED
070/8 ARIN 2004-01 whois.arin.net ALLOCATED
071/8 ARIN 2004-08 whois.arin.net ALLOCATED
072/8 ARIN 2004-08 whois.arin.net ALLOCATED
073/8 ARIN 2005-03 whois.arin.net ALLOCATED
074/8 ARIN 2005-06 whois.arin.net ALLOCATED
075/8 ARIN 2005-06 whois.arin.net ALLOCATED
076/8 ARIN 2005-06 whois.arin.net ALLOCATED
077/8 RIPE NCC 2006-08 whois.ripe.net ALLOCATED
078/8 RIPE NCC 2006-08 whois.ripe.net ALLOCATED
079/8 RIPE NCC 2006-08 whois.ripe.net ALLOCATED
080/8 RIPE NCC 2001-04 whois.ripe.net ALLOCATED
081/8 RIPE NCC 2001-04 whois.ripe.net ALLOCATED
082/8 RIPE NCC 2002-11 whois.ripe.net ALLOCATED
083/8 RIPE NCC 2003-11 whois.ripe.net ALLOCATED
084/8 RIPE NCC 2003-11 whois.ripe.net ALLOCATED
085/8 RIPE NCC 2004-04 whois.ripe.net ALLOCATED
086/8 RIPE NCC 2004-04 whois.ripe.net ALLOCATED
087/8 RIPE NCC 2004-04 whois.ripe.net ALLOCATED
088/8 RIPE NCC 2004-04 whois.ripe.net ALLOCATED
089/8 RIPE NCC 2005-06 whois.ripe.net ALLOCATED
090/8 RIPE NCC 2005-06 whois.ripe.net ALLOCATED
091/8 RIPE NCC 2005-06 whois.ripe.net ALLOCATED
092/8 RIPE NCC 2007-03 whois.ripe.net ALLOCATED
093/8 RIPE NCC 2007-03 whois.ripe.net ALLOCATED
094/8 RIPE NCC 2007-07 whois.ripe.net ALLOCATED
095/8 RIPE NCC 2007-07 whois.ripe.net ALLOCATED
096/8 ARIN 2006-10 whois.arin.net ALLOCATED
097/8 ARIN 2006-10 whois.arin.net ALLOCATED
098/8 ARIN 2006-10 whois.arin.net ALLOCATED
099/8 ARIN 2006-10 whois.arin.net ALLOCATED
100/8 ARIN 2010-11 whois.arin.net ALLOCATED [5]
101/8 APNIC 2010-08 whois.apnic.net ALLOCATED
102/8 AFRINIC 2011-02 whois.afrinic.net ALLOCATED
103/8 APNIC 2011-02 whois.apnic.net ALLOCATED
104/8 ARIN 2011-02 whois.arin.net ALLOCATED
105/8 AFRINIC 2010-11 whois.afrinic.net ALLOCATED
106/8 APNIC 2011-01 whois.apnic.net ALLOCATED
107/8 ARIN 2010-02 whois.arin.net ALLOCATED
108/8 ARIN 2008-12 whois.arin.net ALLOCATED
109/8 RIPE NCC 2009-01 whois.ripe.net ALLOCATED
110/8 APNIC 2008-11 whois.apnic.net ALLOCATED
111/8 APNIC 2008-11 whois.apnic.net ALLOCATED
112/8 APNIC 2008-05 whois.apnic.net ALLOCATED
113/8 APNIC 2008-05 whois.apnic.net ALLOCATED
114/8 APNIC 2007-10 whois.apnic.net ALLOCATED
115/8 APNIC 2007-10 whois.apnic.net ALLOCATED
116/8 APNIC 2007-01 whois.apnic.net ALLOCATED
117/8 APNIC 2007-01 whois.apnic.net ALLOCATED
118/8 APNIC 2007-01 whois.apnic.net ALLOCATED
119/8 APNIC 2007-01 whois.apnic.net ALLOCATED
120/8 APNIC 2007-01 whois.apnic.net ALLOCATED
121/8 APNIC 2006-01 whois.apnic.net ALLOCATED
122/8 APNIC 2006-01 whois.apnic.net ALLOCATED
123/8 APNIC 2006-01 whois.apnic.net ALLOCATED
124/8 APNIC 2005-01 whois.apnic.net ALLOCATED
125/8 APNIC 2005-01 whois.apnic.net ALLOCATED
126/8 APNIC 2005-01 whois.apnic.net ALLOCATED
127/8 IANA – Loopback 1981-09 RESERVED [6]
128/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
129/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
130/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
131/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
132/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
133/8 Administered by APNIC 1997-03 whois.apnic.net LEGACY
134/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
135/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
136/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
137/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
138/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
139/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
140/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
141/8 Administered by RIPE NCC 1993-05 whois.ripe.net LEGACY
142/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
143/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
144/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
145/8 Administered by RIPE NCC 1993-05 whois.ripe.net LEGACY
146/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
147/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
148/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
149/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
150/8 Administered by APNIC 1993-05 whois.apnic.net LEGACY
151/8 Administered by RIPE NCC 1993-05 whois.ripe.net LEGACY
152/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
153/8 Administered by APNIC 1993-05 whois.apnic.net LEGACY
154/8 Administered by AFRINIC 1993-05 whois.afrinic.net LEGACY
155/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
156/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
157/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
158/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
159/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
160/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
161/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
162/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
163/8 Administered by APNIC 1993-05 whois.apnic.net LEGACY
164/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
165/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
166/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
167/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
168/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
169/8 Administered by ARIN 1993-05 whois.arin.net LEGACY [7]
170/8 Administered by ARIN 1993-05 whois.arin.net LEGACY
171/8 Administered by APNIC 1993-05 whois.apnic.net LEGACY
172/8 Administered by ARIN 1993-05 whois.arin.net LEGACY [8]
173/8 ARIN 2008-02 whois.arin.net ALLOCATED
174/8 ARIN 2008-02 whois.arin.net ALLOCATED
175/8 APNIC 2009-08 whois.apnic.net ALLOCATED
176/8 RIPE NCC 2010-05 whois.ripe.net ALLOCATED
177/8 LACNIC 2010-06 whois.lacnic.net ALLOCATED
178/8 RIPE NCC 2009-01 whois.ripe.net ALLOCATED
179/8 LACNIC 2011-02 whois.lacnic.net ALLOCATED
180/8 APNIC 2009-04 whois.apnic.net ALLOCATED
181/8 LACNIC 2010-06 whois.lacnic.net ALLOCATED
182/8 APNIC 2009-08 whois.apnic.net ALLOCATED
183/8 APNIC 2009-04 whois.apnic.net ALLOCATED
184/8 ARIN 2008-12 whois.arin.net ALLOCATED
185/8 RIPE NCC 2011-02 whois.ripe.net ALLOCATED
186/8 LACNIC 2007-09 whois.lacnic.net ALLOCATED
187/8 LACNIC 2007-09 whois.lacnic.net ALLOCATED
188/8 Administered by RIPE NCC 1993-05 whois.ripe.net LEGACY
189/8 LACNIC 1995-06 whois.lacnic.net ALLOCATED
190/8 LACNIC 1995-06 whois.lacnic.net ALLOCATED
191/8 Administered by LACNIC 1993-05 whois.lacnic.net LEGACY
192/8 Administered by ARIN 1993-05 whois.arin.net LEGACY [9][10]
193/8 RIPE NCC 1993-05 whois.ripe.net ALLOCATED
194/8 RIPE NCC 1993-05 whois.ripe.net ALLOCATED
195/8 RIPE NCC 1993-05 whois.ripe.net ALLOCATED
196/8 Administered by AFRINIC 1993-05 whois.afrinic.net LEGACY
197/8 AFRINIC 2008-10 whois.afrinic.net ALLOCATED
198/8 Administered by ARIN 1993-05 whois.arin.net LEGACY [11]
199/8 ARIN 1993-05 whois.arin.net ALLOCATED
200/8 LACNIC 2002-11 whois.lacnic.net ALLOCATED
201/8 LACNIC 2003-04 whois.lacnic.net ALLOCATED
202/8 APNIC 1993-05 whois.apnic.net ALLOCATED
203/8 APNIC 1993-05 whois.apnic.net ALLOCATED [12]
204/8 ARIN 1994-03 whois.arin.net ALLOCATED
205/8 ARIN 1994-03 whois.arin.net ALLOCATED
206/8 ARIN 1995-04 whois.arin.net ALLOCATED
207/8 ARIN 1995-11 whois.arin.net ALLOCATED
208/8 ARIN 1996-04 whois.arin.net ALLOCATED
209/8 ARIN 1996-06 whois.arin.net ALLOCATED
210/8 APNIC 1996-06 whois.apnic.net ALLOCATED
211/8 APNIC 1996-06 whois.apnic.net ALLOCATED
212/8 RIPE NCC 1997-10 whois.ripe.net ALLOCATED
213/8 RIPE NCC 1993-10 whois.ripe.net ALLOCATED
214/8 US-DOD 1998-03 LEGACY
215/8 US-DOD 1998-03 LEGACY
216/8 ARIN 1998-04 whois.arin.net ALLOCATED
217/8 RIPE NCC 2000-06 whois.ripe.net ALLOCATED
218/8 APNIC 2000-12 whois.apnic.net ALLOCATED
219/8 APNIC 2001-09 whois.apnic.net ALLOCATED
220/8 APNIC 2001-12 whois.apnic.net ALLOCATED
221/8 APNIC 2002-07 whois.apnic.net ALLOCATED
222/8 APNIC 2003-02 whois.apnic.net ALLOCATED
223/8 APNIC 2010-04 whois.apnic.net ALLOCATED
224/8 Multicast 1981-09 RESERVED [13]
225/8 Multicast 1981-09 RESERVED [13]
226/8 Multicast 1981-09 RESERVED [13]
227/8 Multicast 1981-09 RESERVED [13]
228/8 Multicast 1981-09 RESERVED [13]
229/8 Multicast 1981-09 RESERVED [13]
230/8 Multicast 1981-09 RESERVED [13]
231/8 Multicast 1981-09 RESERVED [13]
232/8 Multicast 1981-09 RESERVED [13]
233/8 Multicast 1981-09 RESERVED [13]
234/8 Multicast 1981-09 RESERVED [13][14]
235/8 Multicast 1981-09 RESERVED [13]
236/8 Multicast 1981-09 RESERVED [13]
237/8 Multicast 1981-09 RESERVED [13]
238/8 Multicast 1981-09 RESERVED [13]
239/8 Multicast 1981-09 RESERVED [13][15]
240/8 Future use 1981-09 RESERVED [16]
241/8 Future use 1981-09 RESERVED [16]
242/8 Future use 1981-09 RESERVED [16]
243/8 Future use 1981-09 RESERVED [16]
244/8 Future use 1981-09 RESERVED [16]
245/8 Future use 1981-09 RESERVED [16]
246/8 Future use 1981-09 RESERVED [16]
247/8 Future use 1981-09 RESERVED [16]
248/8 Future use 1981-09 RESERVED [16]
249/8 Future use 1981-09 RESERVED [16]
250/8 Future use 1981-09 RESERVED [16]
251/8 Future use 1981-09 RESERVED [16]
252/8 Future use 1981-09 RESERVED [16]
253/8 Future use 1981-09 RESERVED [16]
254/8 Future use 1981-09 RESERVED [16]
255/8 Future use 1981-09 RESERVED [16][17]

Footnotes

[1]
Indicates the status of address blocks as follows:
RESERVED: designated by the IETF for specific non-global-unicast purposes as noted.
LEGACY: allocated by the central Internet Registry (IR) prior to the Regional Internet Registries
(RIRs). This address space is now administered by individual RIRs as noted, including maintenance
of WHOIS Directory and reverse DNS records. Assignments from these blocks are distributed globally
on a regional basis.
ALLOCATED: delegated entirely to specific RIR as indicated.
UNALLOCATED: not yet allocated or reserved.
[2]
0.0.0.0/8 reserved for self-identification [RFC1122], section 3.2.1.3. 
Reserved by protocol. For authoritative registration, see [IANA registry iana-ipv4-special-registry].
[3]
Reserved for Private-Use Networks [RFC1918].
Complete registration details for 10.0.0.0/8 are found in [IANA registry iana-ipv4-special-registry].
[4]
This was reserved for Public Data Networks [RFC1356]. See [IANA registry public-data-network-numbers].
It was recovered in February 2008 and was subsequently allocated to APNIC in April 2010.
[5]
100.64.0.0/10 reserved for Shared Address Space [RFC6598]. 
Complete registration details for 100.64.0.0/10 are found in [IANA registry iana-ipv4-special-registry].
[6]
127.0.0.0/8 reserved for Loopback [RFC1122], section 3.2.1.3. 
Reserved by protocol. For authoritative registration, see [IANA registry iana-ipv4-special-registry].
[7]
169.254.0.0/16 reserved for Link Local [RFC3927].
Reserved by protocol. For authoritative registration, see [IANA registry iana-ipv4-special-registry].
[8]
172.16.0.0/12 reserved for Private-Use Networks [RFC1918]. 
Complete registration details are found in [IANA registry iana-ipv4-special-registry].
[9]
192.0.2.0/24  reserved for TEST-NET-1 [RFC5737]. 
Complete registration details for 192.0.2.0/24 are found in [IANA registry iana-ipv4-special-registry].
192.88.99.0/24 reserved for 6to4 Relay Anycast [RFC3068]
Complete registration details for 192.88.99.0/24 are found in [IANA registry iana-ipv4-special-registry].
192.88.99.2/32 reserved for 6a44 Relay Anycast [RFC6751] (possibly collocated with 6to4 Relay 
at 192.88.99.1/32 - see [RFC3068] section 2.4)
192.168.0.0/16 reserved for Private-Use Networks [RFC1918]. 
Complete registration details for 192.168.0.0/16 are found in [IANA registry iana-ipv4-special-registry].
[10]
192.0.0.0/24 reserved for IANA IPv4 Special Purpose Address Registry [RFC5736]. 
Complete registration details for 192.0.0.0/24 are found in [IANA registry iana-ipv4-special-registry].
[11]
198.18.0.0/15 reserved for Network Interconnect Device Benchmark Testing [RFC2544]. 
Complete registration details for 198.18.0.0/15 are found in [IANA registry iana-ipv4-special-registry].
198.51.100.0/24 reserved for TEST-NET-2 [RFC5737]. 
Complete registration details for 198.51.100.0/24 are found in [IANA registry iana-ipv4-special-registry].
[12]
203.0.113.0/24 reserved for TEST-NET-3 [RFC5737]. 
Complete registration details for 203.0.113.0/24 are found in [IANA registry iana-ipv4-special-registry].
[13]
Multicast (formerly "Class D") [RFC5771] registered in [IANA registry multicast-addresses]
[14]
Unicast-Prefix-Based IPv4 Multicast Addresses [RFC6034]
[15]
Administratively Scoped IP Multicast [RFC2365]
[16]
Reserved for future use (formerly "Class E") [RFC1112].
Reserved by protocol. For authoritative registration, see [IANA registry iana-ipv4-special-registry].
[17]
255.255.255.255 is reserved for "limited broadcast" destination address [RFC919] and [RFC922].
Complete registration details for 255.255.255.255/32 are found in [IANA registry iana-ipv4-special-registry].

相关资源:

 

IANA IPv4 专用地址注册表

IANA IPv4 Special-Purpose Address Registry

Created
2009-08-19

Last Updated
2013-03-03

This registry is also available in plain text.

Registry included below

* IANA IPv4 Special Purpose Address Registry

IANA IPv4 Special Purpose Address Registry

Registration Procedure(s)

IETF Review

Reference
[RFC5736][RFC-bonica-special-purpose-07]

Note

The IETF has reserved the address block of 192.0.0.0/24 for use for
special purposes relating to protocol assignments. This registry
contains the current assignments made by the IETF from this address
block.

Address prefixes listed in the Special Purpose Address Registry are
not guaranteed routability in any particular local or global context.

Address   Block Name RFC Allocation Date
0.0.0.0/8 “This” Network [RFC1122], section 3.2.1.3 1981-09
10.0.0.0/8 Private-Use [RFC1918] 1996-02
100.64.0.0/10 Shared   Address Space [RFC6598] 2012-04
127.0.0.0/8 Loopback [RFC1122], section 3.2.1.3 1981-09
169.254.0.0/16 Link   Local [RFC3927] 2005-05
172.16.0.0/12 Private-Use [RFC1918] 1996-02
192.0.0.0/24[2] IETF Protocol Assignments [RFC-bonica-special-purpose-07],   section 2.1 2010-01
192.0.0.0/29 DS-Lite [RFC6333] 2011-06
192.0.2.0/24 Documentation   (TEST-NET-1) [RFC5737] 2010-01
192.88.99.0/24 6to4   Relay Anycast [RFC3068] 2001-06
192.168.0.0/16 Private-Use [RFC1918] 1996-02
198.18.0.0/15 Benchmarking [RFC2544] 1999-03
198.51.100.0/24 Documentation   (TEST-NET-2) [RFC5737] 2010-01
203.0.113.0/24 Documentation   (TEST-NET-3) [RFC5737] 2010-01
240.0.0.0/4 Reserved [RFC1112], section 4 1989-08
255.255.255.255/32 Limited   Broadcast [RFC919], section 7 1984-10

Footnotes

[1] Several protocols have been granted exceptions to this rule.  For
examples, see [RFC4379] and [RFC5884].
[2] Not useable unless by virtue of a more specific reservation.

windows 环境变量

Getting and setting environment variables

The variables can be used both in scripts and on the command line. They are usually referenced by putting special symbols in front of or around the variable name. For instance, to display the user home directory, in most scripting environments, the user has to type:

echo $HOME

On DOS, OS/2 or Windows systems, the user has to type this:

echo %HOME%

In Windows PowerShell, the user has to type this:

Write-Output $HOME

DOS, OS/2 and Windows (Command Prompt)

In DOS, OS/2 and Windows, the set command without any arguments displays all environment variables along with their values.

To set a variable to a particular value, use:

set VARIABLE=value

However, this is temporary. Permanent change to the environment variable can be achieved through editing the registry (not recommended for novices) and using the Windows Resource Kit application setx.exe. With the introduction of Windows Vista, the setx command became part of Windows.

Users of the Windows GUI can manipulate variables via <Control Panel:System:Advanced:Environment Variables>; through the Windows Registry this is done changing the values under HKCU\Environment (for user specific variables) and HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment (for System variables).

To set a variable whose name is in another variable:

set %VARNAME%=value

This feature allows certain interesting applications. For example, a uni-dimensional array of elements (vector) may be generated this way:

set VECTOR[%I%]=value of element subscript %I%

:MkVec
set VECNAME=%1
set i=0
:loop
    shift
    if "%1" == "" goto exitloop
    set /a i+=1
    set %VECNAME%[%i%]=%1
    goto loop
:exitloop
exit /B %i%

call :MkVec DOWNAME=Monday Tuesday Wednesday Thursday Friday Saturday Sunday

To see the current value of a particular variable, use:

echo %VARIABLE%

or

set VARIABLE

Note: Please take note that doing so will print out all variables beginning with ‘VARIABLE’. Another example is:

C:\> set p
Path=c:\.. ..
PATHEXT=.COM;.EXE;.BAT;
PROCESSOR_ARCHITECTURE=.. ..
PROCESSOR_IDENTIFIER=x8..
PROCESSOR_LEVEL=6..
PROCESSOR_REVISION=1706..
ProgramFiles=C:\Program.. .
PROMPT=$P$G

To see the value of an array element a double expansion is required: one for the subscript value and an additional expansion for the array element. This may be achieved via Delayed !VARIABLE! Expansion this way:

set DOW=value of Day of Week (1..7)
echo !DOWNAME[%DOW%]!

To delete a variable, the following command is used:

set VARIABLE=

Windows PowerShell

To set a system variable:

Set-Content -Path Env:VARIABLE -value value
$Env:VARIABLE = value # alternate form

Examples of DOS environment variables

%COMSPEC%

This variable contains the full path to the command processor, command.com.

%PATH%

This variable contains a semicolon-delimited list of directories in which the command interpreter will search for executable files. Equivalent to the Unix $PATH variable (although note that PATH on Windows additionally performs the same task as LD_LIBRARY_PATH on Unix-like systems). Note that %PATH% can also be set like this PATH=c:\dos; where SET isn’t required.

%TEMP% and %TMP%

These variables contain the path to the directory where temporary files should be stored.

Examples from Microsoft Windows

Discrete value variables

These variables generally expand to discrete values, such as the current working directory, the current date, or a random number. Some of these are true environment variables and will be expanded by all functions that handle environment variables. Others, like %CD% simply look like environment variables and will only be expanded by some functions and shells. They are not case sensitive.

%CD%

This variable points to the current directory. Equivalent to the output of the command cd when called without arguments.

%DATE%

This variable expands to the current date. The date is displayed according to the current user’s date format preferences.

The following is a way of reformatting the date and time for use in file copies. The example assumes UK format of day month year and the time is set for a 24 hour clock.

@echo off
echo %DATE% %TIME%
for /F "tokens=1-3 delims=/" %%a in ("%DATE%") do set MTH=%%a& set DAY=%%b& set YR=%%c
for /F "tokens=1-3 delims=:." %%a in ("%TIME%") do set HR=%%a& set MIN=%%b& set SEC=%%c
if "%HR:~0,1%"==" " set HR=0%HR:~1,1%
set MYDATE=%YR%%MTH%%DAY%-%HR%%MIN%%SEC%
echo %MYDATE%
%ERRORLEVEL%

This variable points to the current error level. If there was an error in the previous command, it is checked against this.

%RANDOM%

This variable returns a random number between 0 and 32767.

%TIME%

This variable points to the current time. The time is displayed according to the current user’s time format preferences.

System path variables

These variables refer to locations of critical operating system resources, and as such generally are not user-dependent.

%AppData%

Contains the full path to the Application Data directory of the logged-in user. Does not work on Windows NT 4.0 SP6 UK.

%LOCALAPPDATA%

This variable is the temporary files of Applications. Its uses include storing of Desktop Themes, Windows Error Reporting, Caching and profiles of web browsers.

%ComSpec%

This variable contains the full path to the command processor; on Windows NT based operating systems this is cmd.exe, while on Windows 9x and ME it is the DOS command processor, COMMAND.COM.

%PATH%

This variable contains a semicolon-delimited (do not put spaces in between) list of directories in which the command interpreter will search for an executable file that matches the given command. Equivalent to the Unix $PATH variable.

%ProgramFiles%

This variable points to Program Files directory, which stores all the installed program of Windows and others. The default on English-language systems is C:\Program Files. In 64-bit editions of Windows (XP, 2003, Vista), there are also %ProgramFiles(x86)% which defaults to C:\Program Files (x86) and %ProgramW6432% which defaults to C:\Program Files. The %ProgramFiles% itself depends on whether the process requesting the environment variable is itself 32-bit or 64-bit (this is caused by Windows-on-Windows 64-bit redirection).

%CommonProgramFiles%

This variable points to Common Files directory. The default is C:\Program Files\Common Files.

%SystemDrive%

The %SystemDrive% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the drive upon which the system directory was placed. Also see next item.

The value of %SystemDrive% is in most cases C:.

%SystemRoot%

The %SystemRoot% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the location of the system directory, including the drive and path.

The drive is the same as %SystemDrive% and the default path on a clean installation depends upon the version of the operating system. By default, on a clean installation:

  • Windows NT 5.1 (Windows XP) and newer versions use \WINDOWS
  • Windows NT 5.0 (Windows 2000), Windows NT 4.0 and Windows NT 3.1 use \WINNT
  • Windows NT 3.5x uses \WINNT35
  • Windows NT 4.0 Terminal Server use \WTSRV
%WinDir%

This variable points to the Windows directory (on Windows NT-based operating systems it is identical to the %SystemRoot% variable, above). If the System is on drive C: then the default values are:

Note that Windows NT 4 Terminal Server Edition by default installs to C:\WTSRV.

User management variables

These variables store information related to resources and settings owned by various user profiles within the system. As a general rule, these variables do not refer to critical system resources or locations that are necessary for the OS to run.

%AllUsersProfile% (%PROGRAMDATA% for Windows Vista, Windows 7)

The %AllUsersProfile%(%PROGRAMDATA%) variable expands to the full path to the All Users profile directory. This profile contains resources and settings that are used by all system accounts. Shortcut links copied to the All Users’ Start menu or Desktop directories will appear in every user’s Start menu or Desktop, respectively.

%UserDomain%

The variable holds the name of the Workgroup or Windows Domain to which the current user belongs. The related variable, %LOGONSERVER%, holds the hostname of the server that authenticated the current user’s logon credentials (name and password). For Home PCs, and PCs in a Workgroup, the authenticating server is usually the PC itself. For PCs in a Windows Domain, the authenticating server is a domain controller (a primary domain controller, or PDC, in Windows NT 4-based domains).

%UserProfile%

The %UserProfile% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the location of the current user’s profile directory, in which is found that user’s HKCU registry hive (NTUSER).

Users can also use the %USERNAME% variable to determine the active users login identification.

Windows GUI forced variable expansion

In certain cases it is not possible to create file paths containing environment variables using the Windows GUI, and it is necessary to fight with the user interface to make things work as intended.

  • In Windows 7, a shortcut may not contain the variable %USERNAME% in unexpanded form. Trying to create shortcut to \\server\share\accounts\%USERNAME% or C:\users\%USERNAME% will be silently changed to replace %USERNAME% with the account name of the currently logged-in user, when the OK button is pressed on the shortcut properties.
    • This can only be overridden if the %USERNAME% variable is part of a parameter to some other program in the shortcut. For example, %SYSTEMROOT%\Explorer.exe C:\Users\%USERNAME% is not expanded when OK is clicked, but this shortcut is treated as unsafe and displays a warning when opened.
  • In Group Policy Management on Server 2008 R2, a profile directory can not be redirected to a custom directory hierarchy. For example, the desktop can not be redirected to \\server\share\accounts\%USERNAME%\custom\path\desktop. Upon pressing OK, this is silently changed to “Create a directory for each user in the root path” with the path \\server\share\accounts\ pointing to “\username\desktop”.
    • This behavior can only be overridden if the path contains a variable or drive letter that is not currently resolvable at the time of editing the GPO. For example if a mapping for drive Z: does not exist on the server, then the path Z:\directory\%username%\CustomTarget is not expanded when OK is selected.
  • A domain user account may not contain a profile path or home directory path containing an unexpanded %USERNAME% variable. Upon clicking OK, this is silently replaced with the user’s account name.
    • This causes problems for new user creation that is performed by copying an existing user account, if there are additional directories listed after the username in the path. For a pre-existing account with a profile path of \server\share\accounts\DomainUser\profile the Microsoft Management Console doesn’t know which part of the path contains the previous user’s name and doesn’t change the path during the copy, resulting in the new account pointing to the other account’s profile/home paths. The profile/home paths must be manually re-edited to point to the correct location.

Default Values on Microsoft Windows

Variable Windows XP Windows Vista/7
 %ALLUSERSPROFILE% C:\Documents and Settings\All Users C:\ProgramData
 %APPDATA% C:\Documents and Settings\{username}\Application Data C:\Users\{username}\AppData\Roaming
 %COMPUTERNAME% {computername} {computername}
 %COMMONPROGRAMFILES% C:\Program Files\Common Files C:\Program Files\Common Files
 %COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files (only in 64-bit version) C:\Program Files (x86)\Common Files (only in 64-bit version)
 %COMSPEC% C:\Windows\System32\cmd.exe C:\Windows\System32\cmd.exe
 %HOMEDRIVE% C: C:
 %HOMEPATH% \Documents and Settings\{username} \Users\{username}
 %LOCALAPPDATA% C:\Users\{username}\AppData\Local
 %LOGONSERVER% \\{domain_logon_server} \\{domain_logon_server}
 %PATH% C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths} C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}
 %PATHEXT% .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.WSF;.WSH .com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc
 %PROGRAMDATA%  %SystemDrive%\ProgramData
 %PROGRAMFILES%  %SystemDrive%\Program Files  %SystemDrive%\Program Files
 %PROGRAMFILES(X86)%  %SystemDrive%\Program Files (x86) (only in 64-bit version)  %SystemDrive%\Program Files (x86) (only in 64-bit version)
 %PROMPT% Code for current command prompt format. Code is usually $P$G Code for current command prompt format. Code is usually $P$G
 %PSModulePath%  %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
 %PUBLIC%  %SystemDrive%\Users\Public
{Drive}:\$Recycle.Bin C:\Recycle.Bin C:\$Recycle.Bin
 %SystemDrive% C: C:
 %SystemRoot% The Windows directory, usually C:\Windows, formerly C:\WINNT  %SystemDrive%\Windows
 %TEMP% and %TMP%  %SystemDrive%\Documents and Settings\{username}\Local Settings\Temp  %SystemDrive%\Users\{username}\AppData\Local\Temp
 %USERDOMAIN% {userdomain} {userdomain}
 %USERNAME% {username} {username}
 %USERPROFILE%  %SystemDrive%\Documents and Settings\{username}  %SystemDrive%\Users\{username}
 %WINDIR%  %SystemDrive%\Windows  %SystemDrive%\Windows

In this list, there is no environment variable that refers to the location of the user’s My Documents directory, so there is no standard method for setting a program’s home directory to be the My Documents directory.

ISO 3166-1 国家代码表

  • Standards
  • ISO 3166 – Country codes
  • ISO 3166-1 decoding table

ISO 3166-1 decoding table

Last updated:  2012-08-02

 

This decoding table provides the user of ISO 3166-1 with an easy access to the definition  of all 676 code elements available in the alpha-2 code of ISO’s country code standard.

The  content of this document is taken from two sources: The official code list of ISO 3166-1 and the list  of reserved ISO 3166-1 code elements which contains information on code allocations which are not officially  part of ISO 3166-1 (see “Reserved code elements”). The reserved code elements  have different statuses with regard to restrictions on use within ISO’s country code system. Some may  be used – others must not be used.

These statuses – and their approximate meanings  for the user of ISO 3166-1 – are described and colour-coded in Table 1. Tables 2 gives a colour coded,  clickable matrix of all ISO 3166-1 alpha-2 code elements which is linked to Table 3 which gives the  definition of the code element.

For more detailed information please refer  to the section on “Reserved code elements” on our Website.

Contact the ISO 3166 Maintenance Agency

The  ISO 3166/MA  should be contacted through its secretariat. Please use the following address:

ISO  3166 Maintenance Agency c/o International Organization for Standardization Case  postale 56 CH-1211 Genève 20

Telephone: +41 22 749 02 22 Telefax:  +41 22 749 01 55 E-mail: mbinfo@iso.org Web: www.iso.org/iso/country_codes

 

Color
Status of code element What it means
Officially assigned code element Code element may be used without restriction
User-assigned code element Code element may be used without restriction
Exceptionally reserved code element Code element may be used but restrictions may apply
Transitionally reserved code element Code element deleted from ISO 3166-1; stop using ASAP
Indeterminately reserved code element Code element must not be used in ISO 3166-1
Code elements not used at present stage [A] Code element must not be used in ISO 3166-1
Un-assigned code elements Code element free for assignment (by ISO 3166/MA only!)
AA AB AC AD AE AF AG AH AI AJ AK AL AM AN AO AP AQ AR AS AT AU AV AW AX AY AZ
BA BB BC BD BE BF BG BH BI BJ BK BL BM BN BO BP BQ BR BS BT BU BV BW BX BY BZ
CA CB CC CE CD CF CG CH CI CJ CK CL CM CN CO CP CQ CR CS CT CU CV CW CX CY CZ
DA DB DC DD DE DF DG DH DI DJ DK DL DM DN DO DP DQ DR DS DT DU DV DW DX DY DZ
EA EB EC ED EE EF EG EH EI EJ EK EL EM EN EO EP EQ ER ES ET EU EV EW EX EY EZ
FA FB FC FD FE FF FG FH FI FJ FK FL FM FN FO FP FQ FR FS FT FU FV FW FX FY FZ
GA GB GC GD GE GF GG GH GI GJ GK GL GM GN GO GP GQ GR GS GT GU GV GW GX GY GZ
HA HB HC HD HE HF HG HH HI HJ HK HL HM HN HO HP HQ HR HS HT HU HV HW HX HY HZ
IA IB IC ID IE IF IG IH II IJ IK IL IM IN IO IP IQ IR IS IT IU IV IW IX IY IZ
JA JB JC JD JE JF JG JH JI JJ JK JL JM JN JO JP JQ JR JS JT JU JV JW JX JY JZ
KA KB KC KD KE KF KG KH KI KJ KK KL KM KN KO KP KQ KR KS KT KU KV KW KX KY KZ
LA LB LC LD LE LF LG LH LI LJ LK LL LM LN LO LP LQ LR LS LT LU LV LW LX LY LZ
MA MB MC MD ME MF MG MH MI MJ MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ
NA NB NC ND NE NF NG NH NI NJ NK NL NM NN NO NP NQ NR NS NT NU NV NW NX NY NZ
OA OB OC OD OE OF OG OH OI OJ OK OL OM ON OO OP OQ OR OS OT OU OV OW OX OY OZ
PA PB PC PD PE PF PG PH PI PJ PK PL PM PN PO PP PQ PR PS PT PU PV PW PX PY PZ
QA QB QC QD QE QF QG QH QI QJ QK QL QM QN QO QP QQ QR QS QT QU QV QW QX QY QZ
RA RB RC RD RE RF RG RH RI RJ RK RL RM RN RO RP RQ RR RS RT RU RV RW RX RY RZ
SA SB SC SD SE SF SG SH SI SJ SK SL SM SN SO SP SQ SR SS ST SU SV SW SX SY SZ
TA TB TC TD TE TF TG TH TI TJ TK TL TM TN TO TP TQ TR TS TT TU TV TW TX TY TZ
UA UB UC UD UE UF UG UH UI UJ UK UL UM UN UO UP UQ UR US UT UU UV UW UX UY UZ
VA VB VC VD VE VF VG VH VI VJ VK VL VM VN VO VP VQ VR VS VT VU VV VW VX VY VZ
WA WB WC WD WE WF WG WH WI WJ WK WL WM WN WO WP WQ WR WS WT WU WV WW WX WY WZ
XA XB XC XD XE XF XG XH XI XJ XK XL XM XN XO XP XQ XR XS XT XU XV XW XX XY XZ
YA YB YC YD YE YF YG YH YI YJ YK YL YM YN YO YP YQ YR YS YT YU YV YW YX YY YZ
ZA ZB ZC ZD ZE ZF ZG ZH ZI ZJ ZK ZL ZM ZN ZO ZP ZQ ZR ZS ZT ZU ZV ZW ZX ZY ZZ
Code Name Remark Status
AA user-assigned
AC Ascension Island [B] Requested by Universal Postal Union (UPU) exceptionally reserved
AD ANDORRA officially assigned
AE UNITED ARAB EMIRATES officially assigned
AF AFGHANISTAN officially assigned
AG ANTIGUA AND BARBUDA officially assigned
AI ANGUILLA officially assigned
AL ALBANIA officially assigned
AM ARMENIA officially assigned
AN Netherlands Antilles 2011-12 to 2061-12 transitionally reserved
AO ANGOLA officially assigned
AP African Regional Industrial Property Organization [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
AQ ANTARCTICA officially assigned
AR ARGENTINA officially assigned
AS AMERICAN SAMOA officially assigned
AT AUSTRIA officially assigned
AU AUSTRALIA officially assigned
AW ARUBA officially assigned
AX ÅLAND ISLANDS officially assigned
AZ AZERBAIJAN officially assigned
BA BOSNIA AND HERZEGOVINA officially assigned
BB BARBADOS officially assigned
BD BANGLADESH officially assigned
BE BELGIUM officially assigned
BF BURKINA FASO officially assigned
BG BULGARIA officially assigned
BH BAHRAIN officially assigned
BI BURUNDI officially assigned
BJ BENIN officially assigned
BL SAINT BARTHÉLEMY officially assigned
BM BERMUDA officially assigned
BN BRUNEI DARUSSALAM officially assigned
BO BOLIVIA, PLURINATIONAL STATE OF officially assigned
BQ BONAIRE, SINT EUSTATIUS AND SABA officially assigned
BR BRAZIL officially assigned
BS BAHAMAS officially assigned
BT BHUTAN officially assigned
BU Burma 1989-12 to 2039-12 transitionally reserved
BV BOUVET ISLAND officially assigned
BW BOTSWANA officially assigned
BX Benelux Trademarks and Designs Office [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
BY BELARUS officially assigned
BZ BELIZE officially assigned
CA CANADA officially assigned
CC COCOS (KEELING) ISLANDS officially assigned
CD CONGO, THE DEMOCRATIC REPUBLIC OF THE officially assigned
CF CENTRAL AFRICAN REPUBLIC officially assigned
CG CONGO officially assigned
CH SWITZERLAND officially assigned
CI CÔTE D’IVOIRE officially assigned
CK COOK ISLANDS officially assigned
CL CHILE officially assigned
CM CAMEROON officially assigned
CN CHINA officially assigned
CO COLOMBIA officially assigned
CP Clipperton Island [C] Requested by International Telecommunication Union (ITU) exceptionally reserved
CR COSTA RICA officially assigned
CS SERBIA AND MONTENEGRO 2006-09 to 2056-09 transitionally reserved
CU CUBA officially assigned
CV CAPE VERDE officially assigned
CW CURAÇAO officially assigned
CX CHRISTMAS ISLAND officially assigned
CY CYPRUS officially assigned
CZ CZECH REPUBLIC officially assigned
DE GERMANY officially assigned
DG Diego Garcia [C] Requested by International Telecommunication Union (ITU) exceptionally reserved
DJ DJIBOUTI officially assigned
DK DENMARK officially assigned
DM DOMINICA officially assigned
DO DOMINICAN REPUBLIC officially assigned
DY Benin [D] Requested by Secretary-General of UN for Road Traffic Conventions R49 and R68 indeterminately reserved
DZ ALGERIA officially assigned
EA Ceuta, Melilla [E] Requested by World Customs Organization (WCO) exceptionally reserved
EC ECUADOR officially assigned
EE ESTONIA officially assigned
EF Union of Countries under the European Community Patent Convention [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
EG EGYPT officially assigned
EH WESTERN SAHARA officially assigned
EM European Trademark Office [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
EP European Patent Organization [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
ER ERITREA officially assigned
ES SPAIN officially assigned
ET ETHIOPIA officially assigned
EU European Union Requested by ISO 4217/MA (March 1998) for ISO 6166 “Securities – International securities identification numbering system (ISIN)”. In August 1999, extension of scope to any application needing to represent the name European Union. exceptionally reserved
EV Eurasian Patent Organization [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
EW Estonia [D] indeterminately reserved
FI FINLAND officially assigned
FJ FIJI officially assigned
FK FALKLAND ISLANDS (MALVINAS) officially assigned
FL Liechtenstein [D] indeterminately reserved
FM MICRONESIA, FEDERATED STATES OF officially assigned
FO FAROE ISLANDS officially assigned
FR FRANCE officially assigned
FX France, Metropolitan Requested by France exceptionally reserved
GA GABON officially assigned
GB UNITED KINGDOM officially assigned
GC Patent Office of the Cooperation Council for the Arab States of the Gulf (GCC) [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
GD GRENADA officially assigned
GE GEORGIA officially assigned
GF FRENCH GUIANA officially assigned
GG GUERNSEY officially assigned
GH GHANA officially assigned
GI GIBRALTAR officially assigned
GL GREENLAND officially assigned
GM GAMBIA officially assigned
GN GUINEA officially assigned
GP GUADELOUPE officially assigned
GQ EQUATORIAL GUINEA officially assigned
GR GREECE officially assigned
GS SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS officially assigned
GT GUATEMALA officially assigned
GU GUAM officially assigned
GW GUINEA-BISSAU officially assigned
GY GUYANA officially assigned
HK HONG KONG officially assigned
HM HEARD ISLAND AND MCDONALD ISLANDS officially assigned
HN HONDURAS officially assigned
HR CROATIA officially assigned
HT HAITI officially assigned
HU HUNGARY officially assigned
IB International Bureau of WIPO [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
IC Canary Islands [E] Requested by World Customs Organization (WCO) exceptionally reserved
ID INDONESIA officially assigned
IE IRELAND officially assigned
IL ISRAEL officially assigned
IM ISLE OF MAN officially assigned
IN INDIA officially assigned
IO BRITISH INDIAN OCEAN TERRITORY officially assigned
IQ IRAQ officially assigned
IR IRAN, ISLAMIC REPUBLIC OF officially assigned
IS ICELAND officially assigned
IT ITALY officially assigned
JA Jamaica [F] Requested by Secretary-General of UN for Road Traffic Conventions indeterminately reserved
JE JERSEY officially assigned
JM JAMAICA officially assigned
JO JORDAN officially assigned
JP JAPAN officially assigned
KE KENYA officially assigned
KG KYRGYZSTAN officially assigned
KH CAMBODIA officially assigned
KI KIRIBATI officially assigned
KM COMOROS officially assigned
KN SAINT KITTS AND NEVIS officially assigned
KP KOREA, DEMOCRATIC PEOPLE’S REPUBLIC OF officially assigned
KR KOREA, REPUBLIC OF officially assigned
KW KUWAIT officially assigned
KY CAYMAN ISLANDS officially assigned
KZ KAZAKHSTAN officially assigned
LA LAO PEOPLE’S DEMOCRATIC REPUBLIC officially assigned
LB LEBANON officially assigned
LC SAINT LUCIA officially assigned
LF Libya Fezzan [D] indeterminately reserved
LI LIECHTENSTEIN officially assigned
LK SRI LANKA officially assigned
LR LIBERIA officially assigned
LS LESOTHO officially assigned
LT LITHUANIA officially assigned
LU LUXEMBOURG officially assigned
LV LATVIA officially assigned
LY LIBYA officially assigned
MA MOROCCO officially assigned
MC MONACO officially assigned
MD MOLDOVA, REPUBLIC OF officially assigned
ME MONTENEGRO officially assigned
MF SAINT MARTIN (FRENCH PART) officially assigned
MG MADAGASCAR officially assigned
MH MARSHALL ISLANDS officially assigned
MK MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF officially assigned
ML MALI officially assigned
MM MYANMAR officially assigned
MN MONGOLIA officially assigned
MO MACAO officially assigned
MP NORTHERN MARIANA ISLANDS officially assigned
MQ MARTINIQUE officially assigned
MR MAURITANIA officially assigned
MS MONTSERRAT officially assigned
MT MALTA officially assigned
MU MAURITIUS officially assigned
MV MALDIVES officially assigned
MW MALAWI officially assigned
MX MEXICO officially assigned
MY MALAYSIA officially assigned
MZ MOZAMBIQUE officially assigned
NA NAMIBIA officially assigned
NC NEW CALEDONIA officially assigned
NE NIGER officially assigned
NF NORFOLK ISLAND officially assigned
NG NIGERIA officially assigned
NI NICARAGUA officially assigned
NL NETHERLANDS Includes: the islands Bonaire, Saint Eustatius and Saba officially assigned
NO NORWAY officially assigned
NP NEPAL officially assigned
NR NAURU officially assigned
NT Neutral Zone 1993-07 to 2043-07 transitionally reserved
NU NIUE officially assigned
NZ NEW ZEALAND officially assigned
OA African Intellectual Property Organization [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
OM OMAN officially assigned
PA PANAMA officially assigned
PE PERU officially assigned
PF FRENCH POLYNESIA officially assigned
PG PAPUA NEW GUINEA officially assigned
PH PHILIPPINES officially assigned
PI Philippines [F] indeterminately reserved
PK PAKISTAN officially assigned
PL POLAND officially assigned
PM SAINT PIERRE AND MIQUELON officially assigned
PN PITCAIRN officially assigned
PR PUERTO RICO officially assigned
PS PALESTINIAN TERRITORY, OCCUPIED officially assigned
PT PORTUGAL officially assigned
PW PALAU officially assigned
PY PARAGUAY officially assigned
QA QATAR officially assigned
QM user-assigned
QN user-assigned
QO user-assigned
QP user-assigned
QQ user-assigned
QR user-assigned
QS user-assigned
QT user-assigned
QU user-assigned
QV user-assigned
QW user-assigned
QX user-assigned
QY user-assigned
QZ user-assigned
RA Argentina [F] indeterminately reserved
RB Bolivia [cf. Botswana: identical code element] [D] indeterminately reserved
RC China [F] indeterminately reserved
RE RÉUNION officially assigned
RH Haiti [D] indeterminately reserved
RI Indonesia [F] indeterminately reserved
RL Lebanon [F] indeterminately reserved
RM Madagascar [F] indeterminately reserved
RN Niger [G] indeterminately reserved
RO ROMANIA officially assigned
RP Philippines [G] indeterminately reserved
RS SERBIA officially assigned
RU RUSSIAN FEDERATION officially assigned
RW RWANDA officially assigned
SA SAUDI ARABIA officially assigned
SB SOLOMON ISLANDS officially assigned
SC SEYCHELLES officially assigned
SD SUDAN officially assigned
SE SWEDEN officially assigned
SF Finland [D] indeterminately reserved
SG SINGAPORE officially assigned
SH SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA officially assigned
SI SLOVENIA officially assigned
SJ SVALBARD AND JAN MAYEN officially assigned
SK SLOVAKIA officially assigned
SL SIERRA LEONE officially assigned
SM SAN MARINO officially assigned
SN SENEGAL officially assigned
SO SOMALIA officially assigned
SR SURINAME officially assigned
SS SOUTH SUDAN officially assigned
ST SAO TOME AND PRINCIPE officially assigned
SU USSR Requested by Foundation of Internet Development (FID) exceptionally reserved
SV EL SALVADOR officially assigned
SX SINT MAARTEN (DUTCH PART) The island of Saint Martin is divided into the French northern part and the Dutch southern part officially assigned
SY SYRIAN ARAB REPUBLIC officially assigned
SZ SWAZILAND officially assigned
TA Tristan da Cunha [B] Requested by Universal Postal Union (UPU) exceptionally reserved
TC TURKS AND CAICOS ISLANDS officially assigned
TD CHAD officially assigned
TF FRENCH SOUTHERN TERRITORIES officially assigned
TG TOGO officially assigned
TH THAILAND officially assigned
TJ TAJIKISTAN officially assigned
TK TOKELAU officially assigned
TL TIMOR-LESTE officially assigned
TM TURKMENISTAN officially assigned
TN TUNISIA officially assigned
TO TONGA officially assigned
TP East Timor 2002-05 to 2052-05 transitionally reserved
TR TURKEY officially assigned
TT TRINIDAD AND TOBAGO officially assigned
TV TUVALU officially assigned
TW TAIWAN, PROVINCE OF CHINA officially assigned
TZ TANZANIA, UNITED REPUBLIC OF officially assigned
UA UKRAINE officially assigned
UG UGANDA officially assigned
UK United Kingdom Requested by United Kingdom exceptionally reserved
UM UNITED STATES MINOR OUTLYING ISLANDS officially assigned
US UNITED STATES officially assigned
UY URUGUAY officially assigned
UZ UZBEKISTAN officially assigned
VA HOLY SEE (VATICAN CITY STATE) officially assigned
VC SAINT VINCENT AND THE GRENADINES officially assigned
VE VENEZUELA, BOLIVARIAN REPUBLIC officially assigned
VG VIRGIN ISLANDS, BRITISH officially assigned
VI VIRGIN ISLANDS, U.S. officially assigned
VN VIET NAM officially assigned
VU VANUATU officially assigned
WF WALLIS AND FUTUNA officially assigned
WG Grenada [D] indeterminately reserved
WL Saint Lucia [D] indeterminately reserved
WO World Intellectual Property Organization [A] Requested by World Intellectual Property Organization (WIPO) for use in Standard ST.3 indeterminately reserved
WS SAMOA officially assigned
WV Saint Vincent [D] indeterminately reserved
XA user-assigned
XB user-assigned
XC user-assigned
XD user-assigned
XE user-assigned
XF user-assigned
XG user-assigned
XH user-assigned
XI user-assigned
XJ user-assigned
XK user-assigned
XL user-assigned
XM user-assigned
XN user-assigned
XO user-assigned
XP user-assigned
XQ user-assigned
XR user-assigned
XS user-assigned
XT user-assigned
XU user-assigned
XV user-assigned
XW user-assigned
XX user-assigned
XY user-assigned
XZ user-assigned
YE YEMEN officially assigned
YT MAYOTTE officially assigned
YU Yugoslavia 2003-07 to 2053-07 transitionally reserved
YV Venezuela [D] indeterminately reserved
ZA SOUTH AFRICA officially assigned
ZM ZAMBIA officially assigned
ZR Zaire 1997-07 to 2047-07 transitionally reserved
ZW ZIMBABWE officially assigned
ZZ user-assigned

Notes:

 

[A]  The World Intellectual Property Organization (WIPO) uses ten alpha-2 code elements for particular purposes  in its Standard ST.3 which are not assigned in ISO 3166-1. The ISO 3166/MA will not use these alpha-2  code elements for assignment in ISO 3166 at the present stage.

[B]  Official country names are given in CAPITAL LETTERS. Other names are given in normal orthography i.e  including lower case letters.

[C]  The list of ISO 3166-1 reserved code elements is only available in English, hence the lack of French  names for entries which are not officially included in ISO 3166-1.

[D] Here the following pieces of information can  be given:

  • Acronym of organization or name of country  on whose behalf a reservation was made
  • Date of reservation (for transitional reservations)
  • Abbreviation of source document for reserved code element
  • Explanatory text