combine c# program and stuff in just 1 program
I have pictures, gifs, textfiles, console applications needed by my c# program. They are all in the same directory with my c# program.
If they downloaded my program, it should be in a single p开发者_JAVA技巧ackage, a single exe file, all the pics are there, all the dependencies, console apps, bat files.
How can I combine everything in one package? So that users will not see all textfiles, gifs, etc.?
You need to make them Embedded Resources. you can set that in the Property window when the resources are selected in the Solution Explorer.
You need to use resources
to embed images etc
in the assembly. Have a look at this link.
You should use the visual studio deployment wizard to make a setup project that will include all the files and will execute your exe while the installation is in progress and when you build your application there will be only one file "exe or msi".For this Go to Projects->setup and Deployment->Setup project and then create one.You can search online or msdn provides very good samples for that as well.
Thanks
As mentioned, you need to add the content as Resources to your application. If you're using Visual Studio, just right-click your project and select "Add new Item..."
Then in the list, select "Resource File" (file should be something like Resources.resx)
Then in your Solution Explorer, just open the resource file and add your content to it.
To access it in code, just go
Bitmap image = Resources.myImage;
or
string textData = Resources.myTextData;
精彩评论