ArgumentException.Message 屬性

定義

取得錯誤訊息和參數名稱,在參數名稱未設定時只會取得錯誤訊息。

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

屬性值

描述例外狀況之詳細資料的文字字串。 這個屬性值是下列兩種形式中的一種:

條件
paramName 是 Null 參考 (在 Visual Basic 中為 Nothing) 或長度為零。 傳遞給建構函式的 message 字串。
paramName 不是 Null 參考 (在 Visual Basic 中為 Nothing) 且長度大於零。 與無效參數名稱附加在一起的 message 字串。

備註

這個屬性會 Message 覆寫 。 錯誤訊息應當地語系化。

適用於