首页 > 其他 > 详细

C# 反射

时间:2014-10-08 16:10:05      阅读:141      评论:0      收藏:0      [点我收藏+]
 System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            Type[] types = assembly.GetTypes();

  types得到当前程序集下所有的类

 

 Type formType = (Type)((SourceGrid.Cells.Cell)cellContext.Cell).Tag;//将object类型强制转换为指定的类型
            Form form = (Form)System.Activator.CreateInstance(formType);创建指定类型的实例
            form.Owner = this;
            form.Show();

C# 反射

原文:http://www.cnblogs.com/ConstSurpass/p/4011125.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!