Freigeben über


Byte.MinValue-Feld

Stellt den kleinstmöglichen Wert von Byte dar. Dieses Feld ist konstant.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Const MinValue As Byte
'Usage
Dim value As Byte

value = Byte.MinValue
public const byte MinValue
public:
literal unsigned char MinValue
public static final byte MinValue
public const var MinValue : byte

Hinweise

Der Wert dieser Konstanten ist 0 (null).

Beispiel

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

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

Byte-Struktur
Byte-Member
System-Namespace
MaxValue