IPAddress.GetAddressBytes Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a copy of the IPAddress as an array of bytes in network order.
public:
cli::array <System::Byte> ^ GetAddressBytes();
public byte[] GetAddressBytes ();
member this.GetAddressBytes : unit -> byte[]
Public Function GetAddressBytes () As Byte()
Returns
Byte[]
A Byte array.
Examples
The following code example shows how to get a server IP address in byte format.
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
Applies to
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.