现在的位置: 首页 > 综合 > 正文

动态加载 dll

2013年10月24日 ⁄ 综合 ⁄ 共 609字 ⁄ 字号 评论关闭

string OutString=string.Empty;
   string Txtstr;
   System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(System.AppDomain.CurrentDomain.BaseDirectory + " //ASAP.Extend.LablePrinter.dll");
         Type tp = asm.GetType("LableClassLibrary.LableClass");
         object obj = System.Activator.CreateInstance(tp);
         System.Reflection.MethodInfo GetConfig = tp.GetMethod("GetConfig");
        
        
         OutString+=Convert.ToString(GetConfig.Invoke(obj,new object[]{this,System.AppDomain.CurrentDomain.BaseDirectory + " //LablePrinter.xml",1}));
         MessageBox.Show(OutString);
         MessageBox.Show(OutString);

抱歉!评论已关闭.