解释 System.Net.IPAddress 的实例属性
我在理解 System.Net 时遇到了一些困难.IPAddress
class,因为我不知道在哪里查找某些属性所指的定义。具体来说,是什么:
IPAddress.IsIPv6LinkLocal
IPAddress.IsIPv6Multicast
IPAddress.IsIPv6SiteLocal
IPAddress.IsIPv6Teredo
我也很乐意接受指向解释这些概念的资源的答案。 MSDN 站点已被证明是不够的。
I'm having a little trouble understanding the System.Net.IPAddress
class, because I don't know where to look for a definition of what some of the properties are referring to. Specifically, what are:
IPAddress.IsIPv6LinkLocal
IPAddress.IsIPv6Multicast
IPAddress.IsIPv6SiteLocal
IPAddress.IsIPv6Teredo
I will also happily accept an answer that points to a resource that explains these concepts. The MSDN site has proved insufficient.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IPAddress.IsIPv6LinkLocal
IPAddress.IsIPv6Multicast
IPAddress.IsIPv6SiteLocal
IPAddress.IsIPv6Teredo
IPAddress.IsIPv6LinkLocal
IPAddress.IsIPv6Multicast
IPAddress.IsIPv6SiteLocal
IPAddress.IsIPv6Teredo
CodeNaked的答案几乎是正确的,但请注意IPAddress.IsIPv6SiteLocal。原始 IPv6 站点本地地址 (fec0::/10) 已弃用。
如今,使用唯一本地地址 (ULA) 来代替站点本地地址。 ULA 有两个变体: fc00::/8 尚未定义,但将来可能用于在中心位置(ULA Central)注册的内部使用地址。 fd00::/8 正在使用中,无需在任何地方注册。该范围内的前缀是随机生成的。
不幸的是 IsIPv6SiteLocal 仅检查原始已弃用的版本:
它无法识别 ULA Central:
或本地分配的 ULA:
请参阅 https://www.rfc-editor.org/rfc/rfc4193 了解更多详情。
The answer of CodeNaked is almost correct, but please watch out with IPAddress.IsIPv6SiteLocal. The original IPv6 Site Local addresses (fec0::/10) are deprecated.
These days Unique Local Addresses (ULA) are used in place of Site Local. ULA has two variants: fc00::/8 is not defined yet, but might be used in the future for internal-use addresses that are registered in a central place (ULA Central). fd00::/8 is in use and does not have to registered anywhere. Prefixes from this range are generated randomly.
Unfortunately IsIPv6SiteLocal only checks for the original deprecated version:
It does not recognize ULA Central:
Or locally assigned ULA:
Please see https://www.rfc-editor.org/rfc/rfc4193 for further details.
对于本地链接和本地站点:
http://www.tcpipguide.com/free/t_IPv6SpecialAddressesReservedPrivateLinkLocalSiteLo- 3.htm
对于链接本地、站点本地和多播(以及其他):
http://technet.microsoft.com/en-us /library/cc757359(WS.10).aspx
对于 teredo:
http://technet.microsoft.com/en-us/library/bb457011.aspx
HTH
For link local and site local:
http://www.tcpipguide.com/free/t_IPv6SpecialAddressesReservedPrivateLinkLocalSiteLo-3.htm
For link local, site local and multicast (and others as well):
http://technet.microsoft.com/en-us/library/cc757359(WS.10).aspx
For teredo:
http://technet.microsoft.com/en-us/library/bb457011.aspx
HTH