I have seen many tools on the Internet, and you can package the dll into the exe program, but if you package the dll into the exe program,
Some packaged software, there will be problems, if you add a shell, it is estimated that the problem is even greater,
I wonder if there is any way to package the dll together into the exe???? Suddenly, I thought of embedded resources.
As shown in the picture, I changed all the dlls to embedded resources:
Is this okay? No, of course not.
Copy this class into the project, and then, register the dll in the main method, I'm the winform program,
The code is as follows:
/// <summary> The main entry point for the application. /// </summary> [STAThread] static void Main() {
LoadResourceDll.RegistDLL(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Login()); }
Finally, it was done!! An exe file is generated.
|