Share via


IPAddress.TryFormat 方法

定義

多載

TryFormat(Span<Char>, Int32)

嘗試將目前的 IP 位址格式化成提供的範圍。

TryFormat(Span<Byte>, Int32)

嘗試將目前的 IP 位址格式化成提供的範圍。

TryFormat(Span<Char>, Int32)

來源:
IPAddress.cs
來源:
IPAddress.cs
來源:
IPAddress.cs

嘗試將目前的 IP 位址格式化成提供的範圍。

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>

當此方法傳回時,為以字元範圍表示的 IP 位址。

charsWritten
Int32

當此方法傳回時,寫入到範圍的字元數目。

傳回

若格式化成功則為 true,否則為 false

適用於

TryFormat(Span<Byte>, Int32)

來源:
IPAddress.cs
來源:
IPAddress.cs

嘗試將目前的 IP 位址格式化成提供的範圍。

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>

要寫入IP位址作為UTF-8位元組範圍的範圍。

bytesWritten
Int32

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

傳回

若格式化成功則為 true,否則為 false

適用於