UInt16.MinValue 字段

表示 UInt16 的最小可能值。此字段为常数。

此字段不符合 CLS。 

**命名空间:**System
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Const MinValue As UShort
用法
Dim value As UShort

value = UShort.MinValue
public const ushort MinValue
public:
literal unsigned short MinValue
public static final UInt16 MinValue
public const var MinValue : ushort

备注

此常数的值是 0。

示例

public class Temperature {
    public static ushort MinValue {
        get {
            return UInt16.MinValue;
        }
    }

    public static ushort MaxValue {
        get {
            return UInt16.MaxValue;
        }
    }

    // The value holder
    protected ushort m_value;

    public ushort Value {
        get {
            return m_value;
        }
        set {
            m_value = value;
        }
    }

}
   public ref class Temperature
   {
   protected:

      // The value holder
      short m_value;

   public:

      static property short MinValue 
      {
         short get()
         {
            return UInt16::MinValue;
         }

      }

      static property short MaxValue 
      {
         short get()
         {
            return UInt16::MaxValue;
         }

      }

      property short Value 
      {
         short get()
         {
            return m_value;
         }

         void set( short value )
         {
            m_value = value;
         }

      }

      property short Celsius 
      {
         short get()
         {
            return (short)((m_value - 32) / 2);
         }

         void set( short value )
         {
            m_value = (short)(value * 2 + 32);
         }

      }

   };

}
public class Temperature
{
    /** @property 
     */
    public static int get_MinValue()
    {
        return System.Convert.ToInt16(UInt16.MinValue);
    } //get_MinValue

    /** @property 
     */
    public static int get_MaxValue()
    {
        return System.Convert.ToInt16(UInt16.MaxValue);
    } //get_MaxValue

    // The value holder
    protected int mValue;

    /** @property 
     */
    public int get_Value()
    {
        return mValue;
    } //get_Value

    /** @property 
     */
    public void set_Value(int value)
    {
        mValue = value;
    } //set_Value
} //Temperature
public class Temperature {
    public static function get MinValue() : ushort {
        return UInt16.MinValue;
    }

    public static function get MaxValue() : ushort {
        return UInt16.MaxValue;
    }

    // The value holder
    protected var m_value : ushort ;

    public function get Value() : ushort {
        return m_value;
            }
            
            public function set Value(value : ushort) {                        
        m_value = value;
    }

}

平台

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 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

UInt16 结构
UInt16 成员
System 命名空间
MaxValue