请问:C#中的“[]”表示什么?例如下面的代码:
        [Category("Behaviour")]
        [Description("Get or sets the control to validate.")]
        [DefaultValue(null)]
        [TypeConverter(typeof(ValidatableControlConverter))]

解决方案 »

  1.   

    DefaultValue 属于System.ComponentModel.DefaultValueAttribute类中,设置属性的初始值。
    Description 用于描述属性。
    方括号 ([]) 用于数组、索引器和属性,也可用于指针。
      

  2.   

    Attribute
    详见msdn
    英文介绍
    http://msdn.microsoft.com/en-us/library/system.attribute.aspx
    中文介绍
    http://msdn.microsoft.com/zh-cn/library/system.attribute.aspx
      

  3.   

    DefaultValue 属于System.ComponentModel.DefaultValueAttribute类中,设置属性的初始值。
    Description 用于描述属性。
    方括号 ([]) 用于数组、索引器和属性,也可用于指针。
      

  4.   

    Attribute 类
    可以是程序集、类、构造函数、委托、枚举、事件、字段、接口、方法、可移植可执行文件模块、参数、属性 (Property)、返回值、结构或其他属性 (Attribute)
      

  5.   


    Attribute 类,请问它在程序段中一般起什么作用呢?
      

  6.   


    用于属性时,下面的代码:
      [Category("Behaviour")]
      [Description("Get or sets the control to validate.")]
      [DefaultValue(null)]
      [TypeConverter(typeof(ValidatableControlConverter))]
    表示属性,有什么作用。