Byte.MaxValue フィールド
Byte の最大有効値を表します。このフィールドは定数です。
名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文


Public Sub MinMaxFields(ByVal numberToSet As Integer) If numberToSet <= CInt([Byte].MaxValue) And numberToSet >= CInt([Byte].MinValue) Then ' You must explicitly convert an integer to a byte. MemberByte = CType(numberToSet, [Byte]) ' Displays MemberByte using the ToString() method. Console.WriteLine("The MemberByte value is {0}", MemberByte.ToString()) Else Console.WriteLine("The value {0} is outside of the range of possible Byte values", numberToSet.ToString()) End If End Sub 'MinMaxFields
public void MinMaxFields(int numberToSet) { if(numberToSet <= (int)Byte.MaxValue && numberToSet >= (int)Byte.MinValue) { // You must explicitly convert an integer to a byte. MemberByte = (Byte)numberToSet; // Displays MemberByte using the ToString() method. Console.WriteLine("The MemberByte value is {0}", MemberByte.ToString()); } else { Console.WriteLine("The value {0} is outside of the range of possible Byte values", numberToSet.ToString()); } }
public: void MinMaxFields( Int32 numberToSet ) { if ( numberToSet <= (Int32)Byte::MaxValue && numberToSet >= (Int32)Byte::MinValue ) { // You must explicitly convert an integer to a byte. MemberByte = (Byte)numberToSet; // Displays MemberByte using the ToString() method. Console::WriteLine( "The MemberByte value is {0}", MemberByte.ToString() ); } else { Console::WriteLine( "The value {0} is outside of the range of possible Byte values", numberToSet.ToString() ); } }
public void MinMaxFields(int numberToSet) { if (numberToSet <= (int)(System.Byte.MaxValue) && numberToSet >= (int)(System.Byte.MinValue)) { // You must explicitly convert an integer to a byte. memberByte = ((ubyte)(numberToSet)); // Displays MemberByte using the ToString() method. Console.WriteLine("The memberByte value is {0}", System.Convert.ToString(memberByte)); } else { Console.WriteLine("The value {0} is outside of the range of " + "possible Byte values", (Int32)numberToSet); } } //MinMaxFields

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Byte.MaxValue フィールドのページへのリンク