[Serializable]
public class CommonsDbException : Exception
{
public CommonsDbException()
{
}
public CommonsDbException(string message, object[] args)
{
base.message = string.Format(message, args);
}
public CommonsDbException(string message, Exception innerException) : base(message, innerException)
{
}
protected CommonsDbException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
public CommonsDbException(string message, object[] args)
{
base.message = string.Format(message, args);
}
是無效的,我不能base.Message
設置信息。
我想創建新消息,我該怎麼辦。父親的消息沒有安裝者。
@BlackICE這是不對的。構造函數不會被繼承。 (如果給出零實例構造函數,編譯器會爲您創建一個默認實例構造函數,但這是另一回事。) –