共用方式為


IPAddress.GetAddressBytes 方法

定義

以網路順序提供 作為位元組陣組的複本 IPAddress

public:
 cli::array <System::Byte> ^ GetAddressBytes();
public byte[] GetAddressBytes ();
member this.GetAddressBytes : unit -> byte[]
Public Function GetAddressBytes () As Byte()

傳回

Byte[]

Byte 陣列。

範例

下列程式代碼範例示範如何以位元組格式取得伺服器IP位址。

array<Byte>^bytes = curAdd->GetAddressBytes();
for ( int i = 0; i < bytes->Length; i++ )
{
   Console::Write( bytes[ i ] );

}
Byte[] bytes = curAdd.GetAddressBytes();
for (int i = 0; i < bytes.Length; i++)
{
  Console.Write(bytes[i]);
}
Dim bytes As [Byte]() = curAdd.GetAddressBytes()
Dim i As Integer
For i = 0 To bytes.Length - 1
  Console.Write(bytes(i))
Next i

適用於