Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IPNetwork.Parse Method

Definition

Namespace:
System.Net
Assembly:
System.Net.Primitives.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
Parse(ReadOnlySpan<Byte>)

Converts a UTF-8 CIDR character span to an IPNetwork instance.

Parse(ReadOnlySpan<Char>)

Converts a CIDR character span to an IPNetwork instance.

Parse(String)

Converts a CIDR String to an IPNetwork instance.

Parse(ReadOnlySpan<Byte>)

Source:
IPNetwork.cs
Source:
IPNetwork.cs

Converts a UTF-8 CIDR character span to an IPNetwork instance.

public:
 static System::Net::IPNetwork Parse(ReadOnlySpan<System::Byte> utf8Text);
public static System.Net.IPNetwork Parse(ReadOnlySpan<byte> utf8Text);
static member Parse : ReadOnlySpan<byte> -> System.Net.IPNetwork
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte)) As IPNetwork

Parameters

utf8Text
ReadOnlySpan<Byte>

A UTF-8 character span that defines an IP network in CIDR notation.

Returns

An IPNetwork instance.

Exceptions

utf8Text is not a valid UTF-8 CIDR network string, or the address contains non-zero bits after the network prefix.

Applies to

Parse(ReadOnlySpan<Char>)

Source:
IPNetwork.cs
Source:
IPNetwork.cs
Source:
IPNetwork.cs
Source:
IPNetwork.cs

Converts a CIDR character span to an IPNetwork instance.

public:
 static System::Net::IPNetwork Parse(ReadOnlySpan<char> s);
public static System.Net.IPNetwork Parse(ReadOnlySpan<char> s);
static member Parse : ReadOnlySpan<char> -> System.Net.IPNetwork
Public Shared Function Parse (s As ReadOnlySpan(Of Char)) As IPNetwork

Parameters

s
ReadOnlySpan<Char>

A character span that defines an IP network in CIDR notation.

Returns

An IPNetwork instance.

Exceptions

s is not a valid CIDR network string, or the address contains non-zero bits after the network prefix.

Applies to

Parse(String)

Source:
IPNetwork.cs
Source:
IPNetwork.cs
Source:
IPNetwork.cs
Source:
IPNetwork.cs

Converts a CIDR String to an IPNetwork instance.

public:
 static System::Net::IPNetwork Parse(System::String ^ s);
public static System.Net.IPNetwork Parse(string s);
static member Parse : string -> System.Net.IPNetwork
Public Shared Function Parse (s As String) As IPNetwork

Parameters

s
String

A String that defines an IP network in CIDR notation.

Returns

An IPNetwork instance.

Exceptions

The specified string is null.

s is not a valid CIDR network string, or the address contains non-zero bits after the network prefix.

Applies to


Feedback

Was this page helpful?