简体   繁体   中英

Can System.Net.Mail.Mailmessage be inherited?

I tried to inherit from mailmessage class, but I can't. I want to introduce my own properties in it.

When I type public override , I don't get any override options

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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