IPAddress.TryWriteBytes(Span<Byte>, Int32) 方法

定義

嘗試以網路順序將目前的IP位址寫入位元組範圍。

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

參數

destination
Span<Byte>

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

bytesWritten
Int32

當此方法傳回時,為寫入至範圍的位元組數目。

傳回

若 IP 位址已成功寫入指定的範圍,則為 true;否則為 false

適用於