想要创建运行时类和集合作为给定的例子?我们该怎么办?
问题描述:
大家好,
我想创建一个应该是运行时的类,下面就像我要提到的那样。
I want to create a class which should be runtime, below example like what i am tring to do.
我有客户类
公共类客户{
公共字符串名称; //这个字段想要动态创建
Public string Name;// this field want to create dynamically
公共字符串地址;
}
然后想要使用
列表<客户> obj = new List< Customer>();
List<Customer> obj = new List<Customer>();
obj.Add(new Customer(){Name1 =" aa",Addrss =" as"});
obj.Add(new Customer(){Name1="aa", Addrss="as"});
Ashok
答
Hi Ashok,
Hi Ashok,
检查以下文章。
http:/ /www.codeproject.com/Articles/37254/Creating-classes-at-runtime
关心
Sophia