试一试这个工具:ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output. See the accompanying documentation for details.http://www.microsoft.com/en-us/download/details.aspx?id=17630
只不过想把a.dll放入exe文件内,单纯Assembly.LoadFile也是不行的FileStream fs = new FileStream(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Data.v11.2.dll", FileMode.Create);
fs.Write(Properties.Resources.DevExpress_Data_v11_2, 0, Properties.Resources.DevExpress_Data_v11_2.Length);
fs.Flush();
fs.Close();
FileStream fs1 = new FileStream(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Printing.v11.2.Core.dll", FileMode.Create);
fs1.Write(Properties.Resources.DevExpress_Printing_v11_2_Core, 0, Properties.Resources.DevExpress_Printing_v11_2_Core.Length);
fs1.Flush();
fs1.Close();
FileStream fs2 = new FileStream(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Utils.v11.2.dll", FileMode.Create);
fs2.Write(Properties.Resources.DevExpress_Utils_v11_2, 0, Properties.Resources.DevExpress_Utils_v11_2.Length);
fs2.Flush();
fs2.Close();
FileStream fs3 = new FileStream(System.Windows.Forms.Application.StartupPath + "\\DevExpress.XtraEditors.v11.2.dll", FileMode.Create);
fs3.Write(Properties.Resources.DevExpress_XtraEditors_v11_2, 0, Properties.Resources.DevExpress_XtraEditors_v11_2.Length);
fs3.Flush();
fs3.Close();
Assembly.LoadFile(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Data.v11.2.dll");
Assembly.LoadFile(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Printing.v11.2.Core.dll");
Assembly.LoadFile(System.Windows.Forms.Application.StartupPath + "\\DevExpress.Utils.v11.2.dll");
Assembly.LoadFile(System.Windows.Forms.Application.StartupPath + "\\DevExpress.XtraEditors.v11.2.dll");
Embed an Assembly as a Resource
http://www.codeproject.com/Articles/56197/Embed-an-Assembly-as-a-Resource
参考一下下面这个链接。
http://hi.baidu.com/ifcat/item/44e3b6af549d443f020a4d5d