Freigeben über


IPAddress.GetAddressBytes-Methode

Stellt eine Kopie der IPAddress als Bytearray zur Verfügung.

Namespace: System.Net
Assembly: System (in system.dll)

Syntax

'Declaration
Public Function GetAddressBytes As Byte()
'Usage
Dim instance As IPAddress
Dim returnValue As Byte()

returnValue = instance.GetAddressBytes
public byte[] GetAddressBytes ()
public:
array<unsigned char>^ GetAddressBytes ()
public byte[] GetAddressBytes ()
public function GetAddressBytes () : byte[]

Rückgabewert

Bytearray.

Beispiel

Im folgenden Codebeispiel wird veranschaulicht, wie eine IP-Serveradresse im Byteformat abgerufen wird.

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

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1

.NET Compact Framework

Unterstützt in: 2.0

Siehe auch

Referenz

IPAddress-Klasse
IPAddress-Member
System.Net-Namespace