Share via


IPNetwork.TryFormat 方法

定義

多載

TryFormat(Span<Char>, Int32)

嘗試將的 CIDR 表示法寫入 IPNetwork指定的 destination 範圍,並傳回值,指出作業是否成功。

TryFormat(Span<Byte>, Int32)

嘗試將 IPNetwork的 CIDR 表示法寫入指定的 utf8Destination UTF-8 範圍,並傳回值,指出作業是否成功。

TryFormat(Span<Char>, Int32)

來源:
IPNetwork.cs
來源:
IPNetwork.cs

嘗試將的 CIDR 表示法寫入 IPNetwork指定的 destination 範圍,並傳回值,指出作業是否成功。

public:
 bool TryFormat(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryFormat (Span<char> destination, out int charsWritten);
member this.TryFormat : Span<char> * int -> bool
Public Function TryFormat (destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

參數

destination
Span<Char>

字元的目的地範圍。

charsWritten
Int32

這個方法傳回時,包含寫入 至 destination的字元數。

傳回

true 如果格式設定成功,則為 ;否則為 false

適用於

TryFormat(Span<Byte>, Int32)

來源:
IPNetwork.cs
來源:
IPNetwork.cs

嘗試將 IPNetwork的 CIDR 表示法寫入指定的 utf8Destination UTF-8 範圍,並傳回值,指出作業是否成功。

public:
 bool TryFormat(Span<System::Byte> utf8Destination, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryFormat (Span<byte> utf8Destination, out int bytesWritten);
member this.TryFormat : Span<byte> * int -> bool
Public Function TryFormat (utf8Destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

參數

utf8Destination
Span<Byte>

UTF-8 位元組的目的地範圍。

bytesWritten
Int32

當這個方法傳回時,包含寫入至 utf8Destination的位元組數目。

傳回

true 如果格式設定成功,則為 ;否則為 false

適用於