Skip to content

Attribute

structure

[C#]Attribute 与 反射

Attribute是C#的一种语言特性,用于为各种实体(class,field,property)附加一些说明性信息, 并且可以在运行时环境中检索这些信息(通过反射)。这篇文章介绍了如何去声明和使用一个attribute,并且介绍了反射的基本知识,以及如何运用反射来读取attribute的信息。