摘要: 一个获取反射内容的方法void getreflectioninfo(assembly myassembly) { type[] typearr=myassemby.Gettypes();//获取类型 foreach (type type in typearr)//针对每个类型获取详细信息 { constructorinfo[] myconstructors=type.GetConstructors... 阅读全文
posted @ 2007-08-14 15:53 Microbar 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 反射的作用: 1. 可以使用反射动态地创建类型的实例,将类型绑定到现有对象,或从现有对象中获取类型 2. 应用程序需要在运行时从某个特定的程序集中载入一个特定的类型,以便实现某个任务时可以用到反射。 3. 反射主要应用与类库,这些类库需要知道一个类型的定义,以便提供更多的功能。 1 需要反射的DLL using System; namespace Webtest { public cl... 阅读全文
posted @ 2007-08-14 15:35 Microbar 阅读(1022) 评论(2) 推荐(0) 编辑