Object是标了[Serialzable]的,
你自己写的类还是有必要标...

解决方案 »

  1.   

    可以做到这样,但是你需要设置一下。
    1.在Attribute类中设置一下AttributeUsage:
    [AttributeUsage(AttributeTargets.All, AllowMultiple=true, Inherited=true)]
    2.然后你的父类使用该Attribute类
    3.子类自动继承了父类的attribute
      

  2.   

    goldish:
    我刚开始学C#,对您的解释不太理解
    你的意思是我写一个自己的Attribute类,在类声明中使用[AttributeUsage(AttributeTargets.All, AllowMultiple=true, Inherited=true)] ?好像不行啊,因为Serializable属性是不允许继承的。