I need to have a file containing my data embedded into an exe so when the users call it it will open the file, read it, take action and for the users to not see this file or
Double-click your Properties node in projects
Click Resources, then click the link to create a resources file
Click "Add Resource" and select "Add an existing file". This adds the file to your resources.
The file is added as a public static property of the Resources class that can be accessed by the name given it. in the example, I've added an xml file called "SampleConfiguration". I can access it within code by the following:
var fileString = ActivityLibrary1.Properties.Resources.SampleConfiguration;
Where ActivityLibrary1
is the default namespace of the assembly. As the file was a text file, it was added as a string resource. If you add a binary file, it will be added as a byte array. How to deal with files in byte arrays is another question...