This article is a mirror article of machine translation, please click here to jump to the original article.

View: 41440|Reply: 7

[Source] C# packages the dll into the exe's program

[Copy link]
Posted on 5/26/2016 3:27:14 PM | | | |
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.






Previous:c# clarifies browser cache and cookies by calling Win32 API functions
Next:asp.net administrator or user logs in more than 5 times, turn off the browser login
Posted on 8/8/2017 6:10:34 AM |
The landlord has a lot of ideas
Posted on 8/12/2017 6:46:52 AM |
Like it
Posted on 2/5/2018 1:56:32 PM |
Amazing
Posted on 4/17/2018 5:39:32 PM |
Landlord or me, I want to ask, I put the video into the embedded resource, what reads out is a byte array, is there any way to put it in the player and play it directly (I don't want to write to the local to play in the read path, the video is more than the big card)
Posted on 7/8/2022 7:29:05 PM |
Amazing, like it
Posted on 8/19/2022 8:53:50 AM |
The landlord has a lot of ideas
Posted on 2/28/2023 11:53:43 AM |
Take a look, thanks for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com