리플렉션활용


기존에 만들엇던 dll을 직접 등록하지 않고 런타임시 dll을 로딩해 사용하도록 하였다.


  class Program

    {
        static void Main(string[] args)
        {
            Assembly asm = Assembly.Load("SumBit");
            Type type = asm.GetType("SumBitS.SumBit");
            Object obj = Activator.CreateInstance(type);
            MethodInfo mi = type.GetMethod("Run");
            mi.Invoke(obj,null);
        }
    }


'Programing > C#&.Net' 카테고리의 다른 글

인덱서(Indexer) 예제  (0) 2016.11.30
Delegate(대리자) 프로그램  (0) 2016.11.30
리플렉션(reflection)  (0) 2016.11.30
어셈블리,메타데이터  (0) 2016.11.30
형식 메타데이터  (0) 2016.11.30

+ Recent posts