C# 反射调用DLL里的方法

//dll文件路径
             string path = 
      @"D:VS2015Project01ComputerinDebugcomputer.dll";
 
            //加载dll文件
              Assembly asm = Assembly.LoadFile(path);
  
             //获取类
            Type type = asm.GetType("Computer.Computer");
 
             //创建该类型的实例
             object obj = Activator.CreateInstance(type);
 
             //获取该类的方法
             MethodInfo mf = type.GetMethod("ShowDrives");
 
             //调用方法
             mf.Invoke(obj, null);
原文地址:https://www.cnblogs.com/yuanshuo/p/14569626.html