ArgumentException.Message 屬性


取得錯誤訊息和參數名稱,在參數名稱未設定時只會取得錯誤訊息。Gets the error message and the parameter name, or only the error message if no parameter name is set.

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



描述例外狀況之詳細資料的文字字串。A text string describing the details of the exception. 這個屬性值是下列兩種形式中的一種:The value of this property takes one of two forms:

條件Condition Value
paramName 是 Null 參考 (在 Visual Basic 中為 Nothing) 或長度為零。The paramName is a null reference (Nothing in Visual Basic) or of zero length. 傳遞給建構函式的 message 字串。The message string passed to the constructor.
paramName 不是 Null 參考 (在 Visual Basic 中為 Nothing) 且長度大於零。The paramName is not null reference (Nothing in Visual Basic) and it has a length greater than zero. 與無效參數名稱附加在一起的 message 字串。The message string appended with the name of the invalid parameter.


這個屬性會覆寫 MessageThis property overrides Message. 應將錯誤訊息當地語系化。The error message should be localized.