动态加载 dll

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);

你可能感兴趣的:(dll,object,string)