本文整理汇总了C#中System.Net.IPAddress.IPv6None字段的典型用法代码示例。如果您正苦于以下问题:C# IPAddress.IPv6None字段的具体用法?C# IPAddress.IPv6None怎么用?C# IPAddress.IPv6None使用的例子?那么恭喜您, 这里精选的字段代码示例或许可以为您提供帮助。您也可以进一步了解该字段所在类System.Net.IPAddress
的用法示例。
在下文中一共展示了IPAddress.IPv6None字段的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: displayIPv6NoneAddress
// This method displays the value of the current host's None address in
// standard compressed format. The None address is used by the host to disable
// listening to client activities on all the interfaces.
private static void displayIPv6NoneAddress()
{
try
{
// Get the None address.
IPAddress none = IPAddress.IPv6None;
// Transform the None address to a string using the overloaded
// ToString() method. Note that the resulting string is in the compact
// form: "::".
string ipv6None = none.ToString();
Console.WriteLine("The IPv6 None address is: " + ipv6None);
}
catch (Exception e)
{
Console.WriteLine("[displayIPv6NoneAddress] Exception: " + e.ToString());
}
}