public: static initonly bool IsLittleEndian;
public static readonly bool IsLittleEndian;
staticval mutable IsLittleEndian : bool
Public Shared ReadOnly IsLittleEndian As Boolean
Console::WriteLine( "This example of the BitConverter::IsLittleEndian field "
"generates \nthe following output when run on "
"x86-class computers.\n" );
Console::WriteLine( "IsLittleEndian: {0}", BitConverter::IsLittleEndian );
This example of the BitConverter::IsLittleEndian field generates
the following output when run on x86-class computers.
IsLittleEndian: True
// Example of the BitConverter.IsLittleEndian field.
using System;
class LittleEndDemo
public static void Main( )
Console.WriteLine(
"This example of the BitConverter.IsLittleEndian field " +
"generates \nthe following output when run on " +
"x86-class computers.\n");
Console.WriteLine( "IsLittleEndian: {0}",
BitConverter.IsLittleEndian );
This example of the BitConverter.IsLittleEndian field generates
the following output when run on x86-class computers.
IsLittleEndian: True
open System
printfn $"This example of the BitConverter.IsLittleEndian field generates \nthe following output when run on x86-class computers.\n"
printfn $"IsLittleEndian: {BitConverter.IsLittleEndian}"
// This example of the BitConverter.IsLittleEndian field generates
// the following output when run on x86-class computers.
// IsLittleEndian: True
' Example of the BitConverter.IsLittleEndian field.
Module LittleEndDemo
Sub Main( )
Console.WriteLine( _
"This example of the BitConverter.IsLittleEndian " & _
"field generates " & vbCrLf & "the following output " & _
"when run on x86-class computers." & vbCrLf )
Console.WriteLine( "IsLittleEndian: {0}", _
BitConverter.IsLittleEndian )
End Sub
End Module
' This example of the BitConverter.IsLittleEndian field generates
' the following output when run on x86-class computers.
' IsLittleEndian: True
不同的電腦架構會使用不同的位元組訂單來儲存資料。 「Big-endian」 表示最重要的位元組位於單字的左邊。 「Little-endian」 表示最重要的位元組位於單字的右端。
您可以將 16 位、32 位或 64 位整數傳遞至
IPAddress.HostToNetworkOrder
方法,以從網路位元組順序轉換成主機電腦的位元組順序,而不擷取欄位的值
BitConverter.IsLittleEndian
。