//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");
时间: 2024-10-09 12:37:21