[C#/General] Reflection (선언부에 [메타]특성넣기)


[C#/General] Reflection (선언부에 [메타]특성넣기)

> 어셈블리, 모듈(클래스 및 속성)에 하나 이상의 특성을 적용가능 using System.Text; public class Example { public static void Main() { PrintAuthorInfo(typeof(FirstClass)); PrintAuthorInfo(typeof(SecondClass)); PrintAuthorInfo(typeof(ThirdClass)); } private static void PrintAuthorInfo(System.Type t) { // 리플렉션을 사용하여 속성정보가져오기. System.Attribute[] attrs = System.Attribute.GetCustomAttributes(t); // Reflection. // 속정정보 출력하기. fo..


원문링크 : [C#/General] Reflection (선언부에 [메타]특성넣기)