Partager via


Socket.OSSupportsIPv6 Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets a value indicating whether IPv6 support is available and enabled on the current host.

Namespace:  System.Net.Sockets
Assembly:  System.Net (in System.Net.dll)

Syntax

'Declaration
Public Shared ReadOnly Property OSSupportsIPv6 As Boolean
public static bool OSSupportsIPv6 { get; }

Property Value

Type: System.Boolean
true if the current host supports the IPv4 protocol; otherwise, false.

Remarks

The operating system may support both IPv4 and IPv6 protocols.

Examples

Dim ipv6Supported AS Boolean = Socket.OSSupportsIPv6
If ipv6Supported Then 
  outputBlock.Text &= "IPv6 is supported"
Else
  outputBlock.Text &= "IPv6 is not supported"
End If  
outputBlock.Text &= vbCrLf
bool ipv6Supported = Socket.OSSupportsIPv6;
if (ipv6Supported) 
  outputBlock.Text += "IPv6 is supported\n";
else
  outputBlock.Text += "IPv6 is not supported\n";

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.