2
How do I create a file to put the images in the 'Resources' folder? I don’t want the people who use my program to have access to them. The file can be any extension.
2
How do I create a file to put the images in the 'Resources' folder? I don’t want the people who use my program to have access to them. The file can be any extension.
6
You want to hide resources from the project? You can embed/embed them in Assembly.
Just go the file properties inside Visual Studio, and where it says Build Action
, select Embedded Resource
.
Then you can read the file as follows (if it is a text file):
var assembly = Assembly.GetExecutingAssembly();
var resourceName = assembly.GetName().Name + ".ficheiro.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
}
Browser other questions tagged c# .net visual-studio resources
You are not signed in. Login or sign up in order to post.