Decimal.MaxValue 字段  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 Decimal 的最大可能值。 该字段是常数且为只读。
public: static initonly System::Decimal MaxValue;public static readonly decimal MaxValue; staticval mutable MaxValue : decimalPublic Shared ReadOnly MaxValue As Decimal 字段值
示例
下面的代码示例演示如何使用 MaxValue :
   public ref class PiggyBank
   {
   public:
      Decimal Capacity()
      {
         return MyFortune.MaxValue;
      }
      void AddPenny()
      {
         MyFortune = Decimal::Add(MyFortune, (Decimal).01);
      }
   protected:
      Decimal MyFortune;
   };
}
class PiggyBank {
    public decimal Capacity {
        get {
            return Decimal.MaxValue;
        }
    }
    protected decimal MyFortune;
    public void AddPenny() {
        MyFortune += .01m;
    }
}
Class PiggyBank
    Public ReadOnly Property Capacity() As Decimal
        Get
            Return [Decimal].MaxValue
        End Get
    End Property
    Protected MyFortune As Decimal
    Public Sub AddPenny()
        MyFortune += 0.01D
    End Sub
End Class
注解
此常量的值为正 79,228,162,514,264,337,593,543,950,335。