反射调用外部exe/dll

代码
var filename = Server.MapPath(@"data/a.exe");
Assembly asm
= System.Reflection.Assembly.LoadFile(filename);
Type type
= asm.GetType("aaaa");
Object oper
= Activator.CreateInstance(type);

object[] paras = new object[] { 'a','b'};
MethodInfo method
= t.GetMethod("CreateSMS");
BindingFlags flag
= BindingFlags.Public | BindingFlags.Instance;

object result = method.Invoke(oper, flag, Type.DefaultBinder, paras, null);
原文地址:https://www.cnblogs.com/lvcao2099/p/1913620.html