摘要: 1.通过字符串反射带泛型参数的类。 使用字符反撇---键盘1左边的那个键。 Type listType = Type.GetType(“System.Generic.List'1”); //List<T> Type dicType = Type.GetType(“System.Generic.Dictionary'2”); //Dictionary<K,V>2.识别一个class对象在定义时是否被标记有某个Attribute。 //原始定义 [MyAttribute] class MyClass{} //演示代码代码 object myObj = new 阅读全文
posted @ 2011-06-02 14:01 wpblog 阅读(269) 评论(0) 推荐(0) 编辑