프로그래밍 TIP/.NET
[.NET] Reflection 을 이용해 클래스 내의 메소드 알아보기
여름나라겨울이야기
2008. 10. 29. 16:22
728x90
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ReflectionExam { class TestClass { public void testMethod1() { } public void testMethod2() { } } class Program { static void Main(string[] args) { Type type = typeof(TestClass); System.Reflection.MemberInfo[] members = type.GetMethods(); foreach (System.Reflection.MethodInfo member in members) { Console.WriteLine("포함된 메소드: {0}", member); } } } }
반응형