ArgumentOutOfRangeException.Message 屬性


取得錯誤訊息和無效引數值的字串表示,或如果引數值是 null 時,只取得錯誤訊息。Gets the error message and the string representation of the invalid argument value, or only the error message if the argument value is null.

 virtual property System::String ^ Message { System::String ^ get(); };
public override string Message { get; }
public override string? Message { get; }
member this.Message : string
Public Overrides ReadOnly Property Message As String



這個例外狀況的文字訊息。The text message for this exception. 這個屬性值是下列兩種形式中的一種:The value of this property takes one of two forms, as follows.

條件Condition Value
actualValuenullThe actualValue is null. 傳遞給建構函式的 message 字串。The message string passed to the constructor.
actualValue 不是 nullThe actualValue is not null. 與代表無效參數名稱之字串附加在一起的 message 字串。The message string appended with the string representation of the invalid argument value.


這個屬性會覆寫 MessageThis property overrides Message.

錯誤訊息應描述導致此例外狀況之參數的預期值。The error message should describe the expected values of the parameter that causes this exception. 應將錯誤訊息當地語系化。The error message should be localized.