这是加载.net dll注册到注册表的代码

来源:互联网 发布:2015年进出口数据统计 编辑:程序博客网 时间:2024/05/21 17:58
 //             Assembly t_assembly = Assembly.GetAssembly(typeof(Form_login));
             //        Assembly asm = Assembly.LoadFile(System.IO.Path.GetDirectoryName(t_assembly.Location) +"\\OverlayIcon.dll");
             //         //   MessageBox.Show(System.IO.Path.GetDirectoryName(t_assembly.Location) + "\\OverlayIcon.dll");
             //             //Assembly asm = Assembly.LoadFile(@"D:\work\yxz\windows\yxz\bin\Release\OverlayIcon.dll");

             //           RegistrationServices regAsm = new RegistrationServices();
             //           bool bResult = regAsm.RegisterAssembly(asm, AssemblyRegistrationFlags.SetCodeBase);
             //Assembly asm1 = Assembly.LoadFile(System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(t_assembly.Location) + "\\ShellExtContextMenuHandler.dll"));
             //          // Assembly asm1 = Assembly.LoadFile(@"D:\work\yxz\windows\yxz\bin\Release\ShellExtContextMenuHandler.dll");
             //           RegistrationServices regAsm1 = new RegistrationServices();
             //           bool bResult1 = regAsm1.RegisterAssembly(asm1, AssemblyRegistrationFlags.SetCodeBase);
             //           //if (bResult)
             //           //{
             //           //    MessageBox.Show("注册成功1");
             //           //}
原创粉丝点击