IPAddress.TryFormat(Span<Char>, Int32) 方法

定義

嘗試將目前的 IP 位址格式化成提供的範圍。Tries to format the current IP address into the provided span.

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 位址。When this method returns, the IP address as a span of characters.

charsWritten
Int32

當此方法傳回時,寫入到範圍的字元數目。When this method returns, the number of characters written into the span.

傳回

若格式化成功則為 true,否則為 falsetrue if the formatting was successful; otherwise, false.

適用於