C# 反射调用DLL里的方法
//dll文件路径 string path = @"D:\VS2015Project\001\Computer\bin\Debug\computer.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);