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

定義

嘗試將目前的 IP 位址寫入位元組範圍。Tries to write the current IP address into a span of bytes.

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

bytesWritten
Int32

當此方法傳回時,為寫入至範圍的位元組數目。When this method returns, the number of bytes written into the span.

傳回

若 IP 位址已成功寫入指定的範圍,則為 true;否則為 falsetrue if the IP address is sucessfully written to the given span; otherwise, false.

適用於