IPAddress.TryFormat 方法

定义

重载

TryFormat(Span<Char>, Int32)

尝试将当前 IP 地址格式化为提供的范围。

TryFormat(Span<Byte>, Int32)

尝试将当前 IP 地址格式化为提供的范围。

TryFormat(Span<Char>, Int32)

Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
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)

Source:
IPAddress.cs
Source:
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>

以 UTF-8 字节范围的形式写入 IP 地址的跨度。

bytesWritten
Int32

此方法返回时,包含写入 到 的 utf8Destination字节数。

返回

如果格式设置成功,则为 true;否则为 false

适用于