首页 > 代码库 > 使用用dynamic添加外部DLL引用

使用用dynamic添加外部DLL引用

var dogType = System.Reflection.Assembly.Load("Dogs").GetType("Dogs.Dog");//注意:命名空间加上类名!            dynamic dog = Activator.CreateInstance(dogType);            dog.Speak();            dynamic expando = new System.Dynamic.ExpandoObject();            expando.Name = "DebugLZQ";            expando.Speak = new Action(() => Console.WriteLine("My name is {0}", expando.Name));            expando.Speak();

  

使用用dynamic添加外部DLL引用