简体   繁体   English

System.Net.Mail.Mailmessage可以继承吗?

[英]Can System.Net.Mail.Mailmessage be inherited?

I tried to inherit from mailmessage class, but I can't. 我试图从mailmessage类继承,但是不能。 I want to introduce my own properties in it. 我想在其中介绍我自己的属性。

When I type public override , I don't get any override options 当我键入public overlay时,我没有任何替代选项

here my code 这是我的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;

namespace FoodMenu
{
    public class CustomMailMessage:MailMessage
    {

    }
}

No doubt this class can be inherited as there is no sealed keyword in its declaration. 无疑,此类可以被继承,因为其声明中没有密封的关键字。

public class MailMessage : IDisposable

May be there is no property that can be overrided. 可能没有可以覆盖的属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM