使用用dynamic添加外部DLL引用

var dogType = System.Reflection.Assembly.Load("bigs").GetType("bigs.big");//注意:命名空间加上类名!
            dynamic dog = Activator.CreateInstance(dogType);
            dog.Speak();

            dynamic expando = new System.Dynamic.ExpandoObject();
            expando.Name = "chenxiaofeng";
            expando.Speak = new Action(() => Console.WriteLine("My name is {0}", expando.Name));

            expando.Speak();

  

posted @ 2014-11-20 17:44  爱国蚂蚁  阅读(296)  评论(0编辑  收藏  举报