File recources

  • Thread starter Thread starter Scatropolis
  • Start date Start date
S

Scatropolis

Is there a way that I can add a couple of text files in my project so that
they'd be compiled in the exe? And once I do that, can I access them like
normal files (System.IO.StreamReader)?

Thanks.
 
Hi Scatropolis

You have to include the file and then set it's BuildAction property fo EmbeddedResource. This would embeded the file into the assembly. Once that is done, you could access/load the file using the ResourceManager. But note that you won't be able to update it like you do with stream or so

HTH
fbhca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top