Byte フィールド
Byte メソッド

名前 | 説明 | |
---|---|---|
![]() | CompareTo | オーバーロードされます。 指定したオブジェクトまたは Byte とこのインスタンスを比較し、これらの相対値を示す値を返します。 |
![]() | Equals | オーバーロードされます。 Byte の 2 つのインスタンスが同じ値を表しているかどうかを示す値を返します。 |
![]() | GetHashCode | オーバーライドされます。 このインスタンスのハッシュ コードを返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | GetTypeCode | Byte 値型の TypeCode を返します。 |
![]() | Parse | オーバーロードされます。 数値の文字列形式を、それと等価の Byte に変換します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーロードされます。 オーバーライドされます。 このインスタンスの数値を、それと等価の文字列に変換します。 |
![]() | TryParse | オーバーロードされます。 数値の文字列形式を、それと等価の Byte に変換します。戻り値は、変換が成功したか失敗したかを示します。 |

名前 | 説明 | |
---|---|---|
![]() | System.IConvertible.ToBoolean | Byte のこのインスタンスをブール値に変換します。 |
![]() | System.IConvertible.ToByte | Byte のこのインスタンスの値を返します。 |
![]() | System.IConvertible.ToChar | Byte のこのインスタンスを Unicode 文字に変換します。 |
![]() | System.IConvertible.ToDateTime | この変換はサポートされていません。変換を試みると、InvalidCastException がスローされます。 |
![]() | System.IConvertible.ToDecimal | Byte のこのインスタンスを Decimal 形式に変換します。 |
![]() | System.IConvertible.ToDouble | Byte のこのインスタンスを Double として変換します。 |
![]() | System.IConvertible.ToInt16 | Byte のこのインスタンスを Int16 に変換します。 |
![]() | System.IConvertible.ToInt32 | Byte 値のこのインスタンスを Int32 に変換します。 |
![]() | System.IConvertible.ToInt64 | Byte のこのインスタンスを Int64 に変換します。 |
![]() | System.IConvertible.ToSByte | Byte のこのインスタンスを SByte に変換します。 |
![]() | System.IConvertible.ToSingle | Byte を Single に変換します。 |
![]() | System.IConvertible.ToType | Byte のこのインスタンスを、指定した Type のオブジェクトに変換します。 |
![]() | System.IConvertible.ToUInt16 | Byte のこのインスタンスを UInt16 に変換します。 |
![]() | System.IConvertible.ToUInt32 | Byte を UInt32 に変換します。 |
![]() | System.IConvertible.ToUInt64 | Byte を UInt64 に変換します。 |

Byte メンバ


名前 | 説明 | |
---|---|---|
![]() | CompareTo | オーバーロードされます。 指定したオブジェクトまたは Byte とこのインスタンスを比較し、これらの相対値を示す値を返します。 |
![]() | Equals | オーバーロードされます。 Byte の 2 つのインスタンスが同じ値を表しているかどうかを示す値を返します。 |
![]() | GetHashCode | オーバーライドされます。 このインスタンスのハッシュ コードを返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | GetTypeCode | Byte 値型の TypeCode を返します。 |
![]() | Parse | オーバーロードされます。 数値の文字列形式を、それと等価の Byte に変換します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーロードされます。 オーバーライドされます。 このインスタンスの数値を、それと等価の文字列に変換します。 |
![]() | TryParse | オーバーロードされます。 数値の文字列形式を、それと等価の Byte に変換します。戻り値は、変換が成功したか失敗したかを示します。 |

名前 | 説明 | |
---|---|---|
![]() | System.IConvertible.ToBoolean | Byte のこのインスタンスをブール値に変換します。 |
![]() | System.IConvertible.ToByte | Byte のこのインスタンスの値を返します。 |
![]() | System.IConvertible.ToChar | Byte のこのインスタンスを Unicode 文字に変換します。 |
![]() | System.IConvertible.ToDateTime | この変換はサポートされていません。変換を試みると、InvalidCastException がスローされます。 |
![]() | System.IConvertible.ToDecimal | Byte のこのインスタンスを Decimal 形式に変換します。 |
![]() | System.IConvertible.ToDouble | Byte のこのインスタンスを Double として変換します。 |
![]() | System.IConvertible.ToInt16 | Byte のこのインスタンスを Int16 に変換します。 |
![]() | System.IConvertible.ToInt32 | Byte 値のこのインスタンスを Int32 に変換します。 |
![]() | System.IConvertible.ToInt64 | Byte のこのインスタンスを Int64 に変換します。 |
![]() | System.IConvertible.ToSByte | Byte のこのインスタンスを SByte に変換します。 |
![]() | System.IConvertible.ToSingle | Byte を Single に変換します。 |
![]() | System.IConvertible.ToType | Byte のこのインスタンスを、指定した Type のオブジェクトに変換します。 |
![]() | System.IConvertible.ToUInt16 | Byte のこのインスタンスを UInt16 に変換します。 |
![]() | System.IConvertible.ToUInt32 | Byte を UInt32 に変換します。 |
![]() | System.IConvertible.ToUInt64 | Byte を UInt64 に変換します。 |

Byte 構造体
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Structure Byte Implements IComparable, IFormattable, IConvertible, IComparable(Of Byte), _ IEquatable(Of Byte)
[SerializableAttribute] [ComVisibleAttribute(true)] public struct Byte : IComparable, IFormattable, IConvertible, IComparable<byte>, IEquatable<byte>
[SerializableAttribute] [ComVisibleAttribute(true)] public value class Byte : IComparable, IFormattable, IConvertible, IComparable<unsigned char>, IEquatable<unsigned char>

Byte 値型は、値が 0 から 255 までの範囲の符号なし整数を表します。
Byte は、この型のインスタンスを比較したり、インスタンスの値を文字列形式に変換したり、数値の文字列形式をこの型のインスタンスに変換するためのメソッドを提供します。
書式指定コードで値型の文字列形式を制御する方法については、「書式設定の概要」を参照してください。
この型は、IComparable、IComparable、IFormattable、IConvertible の各インターフェイスを実装します。この型の明示的な IConvertible インターフェイス メンバの実装の代わりに、Convert クラスを使用します。

バイトの配列を 16 進値で表現した文字列に変換する際の Byte の使用例を次に示します。
Class HexTest Private Shared hexDigits As Char() = {"0"c, "1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c, "A"c, "B"c, "C"c, "D"c, "E"c, "F"c} Public Shared Function ToHexString(bytes() As Byte) As String Dim hexStr As String = "" Dim i As Integer For i = 0 To bytes.Length - 1 hexStr = hexStr + Hex(bytes(i)) Next i Return hexStr End Function 'ToHexString Shared Sub Main() Dim b As Byte() = {&H0, &H12, &H34, &H56, &HAA, &H55, &HFF} Console.WriteLine(ToHexString(b)) End Sub 'Main End Class 'HexTest
class HexTest { static char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; public static string ToHexString(byte[] bytes) { char[] chars = new char[bytes.Length * 2]; for (int i = 0; i < bytes.Length; i++) { int b = bytes[i]; chars[i * 2] = hexDigits[b >> 4]; chars[i * 2 + 1] = hexDigits[b & 0xF]; } return new string(chars); } static void Main() { byte[] b = {0x00, 0x12, 0x34, 0x56, 0xAA, 0x55, 0xFF}; Console.WriteLine(ToHexString(b)); } }
ref class HexTest { private: static array<Char>^hexDigits = {'0','1','2','3','4','5' ,'6','7','8','9','A','B','C','D','E','F'}; public: static String^ ToHexString( array<Byte>^bytes ) { array<Char>^chars = gcnew array<Char>(bytes->Length * 2); for ( int i = 0; i < bytes->Length; i++ ) { int b = bytes[ i ]; chars[ i * 2 ] = hexDigits[ b >> 4 ]; chars[ i * 2 + 1 ] = hexDigits[ b & 0xF ]; } return gcnew String( chars ); } }; int main() { array<Byte>^b = {0x00,0x12,0x34,0x56,0xAA,0x55,0xFF}; Console::WriteLine( HexTest::ToHexString( b ) ); }
class HexTest { private static char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; public static String ToHexString(ubyte bytes[]) { char chars[] = new char[bytes.get_Length() * 2]; for (int i = 0; i < bytes.get_Length(); i++) { int b = System.Convert.ToInt32( System.Convert.ToString(bytes.get_Item(i))); chars.set_Item((i * 2), hexDigits.get_Item(b >> 4)); chars.set_Item((i * 2 + 1), hexDigits.get_Item(b & 0xF)); } return new String(chars); } //ToHexString public static void main(String[] args) { ubyte b[] = { 0x0, 0x12, 0x34, 0x56, 0xAA, 0x55, 0xFF }; Console.WriteLine(ToHexString(b)); } //main } //HexTest


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からByTeを検索する場合は、下記のリンクをクリックしてください。

- ByTeのページへのリンク