日期:2014-05-17 浏览次数:21823 次
static class Program
{
[STAThread]
static void Main()
{
string resource1 = "MyApplication1.mydll1.dll"; //dll文件在项目中的路径
string resource2 = "MyApplication1.mydll2.dll"; //dll文件在项目中的路径
EmbeddedAssembly.Load(resource1, "mydll1.dll");
EmbeddedAssembly.Load(resource2, "mydll2.dll");
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
return EmbeddedAssembly.Get(args.Name);
}
}