博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

C#工厂模式,反射时的语法,加载类

Posted on 2009-06-03 10:52  周末  阅读(263)  评论(0编辑  收藏  举报

            string className = string.Format( "CVTT.BLL.{0}.ViewInfo,CVTT.BLL.{0}" , subClassName );
            var temp = Activator.CreateInstance( Type.GetType(className , true ) );
            var temp = System.Reflection.Assembly.Load("CVTT.BLL." + subClassName).CreateInstance("CVTT.BLL." + subClassName + ".ViewInfo");