Byte.MaxValue フィールドとは? わかりやすく解説

Byte.MaxValue フィールド

Byte最大有効値を表します。このフィールド定数です。

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

この定数の値は 255 (16 進数の 0xFF) です。

使用例使用例
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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からByte.MaxValue フィールドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からByte.MaxValue フィールドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からByte.MaxValue フィールド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Byte.MaxValue フィールド」の関連用語

Byte.MaxValue フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Byte.MaxValue フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS