110,536
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Reflection;
namespace CSharpConsole05
{
class Program
{
static void Main(string[] args)
{
//找路径
string dllPath = System.IO.Path.GetDirectoryName(AppDomain.CurrentDomain.GetAssemblies()[0].Location);
//读文件
byte[] formdll = System.IO.File.ReadAllBytes(dllPath + @"\System.Windows.Forms.dll");
//加载
Assembly asm = Assembly.Load(formdll);
//反射
Type type2 = asm.GetType("System.Windows.Forms.Form");
Console.WriteLine(type2.Name);
Console.ReadKey();
}
}
}