Dynamic实现运行时创建对象
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Dynamic;//添加引用命名空间 namespace ConTest { class Dynamic { public static void Main() { dynamic person = new ExpandoObject(); person.Name = "ganquanfu"; person.Age = 23; Console.WriteLine("Name=" + person.Name + "\tAge=" + person.Age); Console.WriteLine(person.Name.GetType().ToString()); Console.Read(); } } }