Note

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

Access to this page requires authorization. You can try .

IPNetwork.TryParse 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
TryParse(ReadOnlySpan<Byte>, IPNetwork)

Converts the specified UTF-8 CIDR character span to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

TryParse(String, IPNetwork)

Converts the specified CIDR string to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

TryParse(ReadOnlySpan<Char>, IPNetwork)

Converts the specified CIDR character span to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

TryParse(ReadOnlySpan<Byte>, IPNetwork)

Source:
IPNetwork.cs
Source:
IPNetwork.cs

Converts the specified UTF-8 CIDR character span to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, [Runtime::InteropServices::Out] System::Net::IPNetwork % result);
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out System.Net.IPNetwork result);
static member TryParse : ReadOnlySpan<byte> * IPNetwork -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), ByRef result As IPNetwork) As Boolean

Parameters

utf8Text
ReadOnlySpan<Byte>

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

result
IPNetwork

When the method returns, contains an IPNetwork instance if the conversion succeeds.

Returns

true if the conversion was successful; otherwise, false.

Applies to

TryParse(String, IPNetwork)

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

Converts the specified CIDR string to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

public:
 static bool TryParse(System::String ^ s, [Runtime::InteropServices::Out] System::Net::IPNetwork % result);
public static bool TryParse(string? s, out System.Net.IPNetwork result);
static member TryParse : string * IPNetwork -> bool
Public Shared Function TryParse (s As String, ByRef result As IPNetwork) As Boolean

Parameters

s
String

A String that defines an IP network in CIDR notation.

result
IPNetwork

When the method returns, contains an IPNetwork instance if the conversion succeeds.

Returns

true if the conversion was successful; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Char>, IPNetwork)

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

Converts the specified CIDR character span to an IPNetwork instance and returns a value indicating whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<char> s, [Runtime::InteropServices::Out] System::Net::IPNetwork % result);
public static bool TryParse(ReadOnlySpan<char> s, out System.Net.IPNetwork result);
static member TryParse : ReadOnlySpan<char> * IPNetwork -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), ByRef result As IPNetwork) As Boolean

Parameters

s
ReadOnlySpan<Char>

A String that defines an IP network in CIDR notation.

result
IPNetwork

When the method returns, contains an IPNetwork instance if the conversion succeeds.

Returns

true if the conversion was successful; otherwise, false.

Applies to


Feedback

Was this page helpful?