首页 > Windows开发 > 详细

[C#]反射相关

时间:2017-07-17 09:33:33      阅读:309      评论:0      收藏:0      [点我收藏+]
 //Type type = DataHelper.Instance.GetType();
            //MethodInfo[] infos = type.GetMethods(BindingFlags.Instance | BindingFlags.Public);

            Assembly ass = System.Reflection.Assembly.LoadFrom(@"D:\DBHelper.dll");
            //Type type = ass.GetType("DBHelper.SqlConn");
            Type type = ass.GetType("DBHelper.Datahelper",false,true);
            MemberInfo[] infos = type.GetMembers();

            //object reflectTest = Activator.CreateInstance(type,false);
            //MethodInfo info = type.GetMethod("GetConn", new Type[] { typeof(string) });

            //string conn = (string)info.Invoke(reflectTest, new string[] { "D" });
            
            //string conn = DBHelper.SqlConn.GetConn("D");

            //DataTable dt = DataHelper.Instance.GetDataTable("select * from C", "D");

 

[C#]反射相关

原文:http://www.cnblogs.com/z5337/p/7192682.html

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