Copy Content Text File in Project to a Folder or a String

V

vjunkl

Hello, I have a content text file in my project and I'd like to copy
it to a folder at some point in the execution of the application(not
during a build).

If this is not possible, how about reading a content text file into a
string. This will do the job just as well, maybe better.

Thanks in advance.

Vince
 
E

Eric Renken

Can you embed the file as a resource and then you can stream the file out?

Here is an example of how I stream out a XML file from my DLL.

System.IO.Stream strm =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
"MyDll.MyXML.xml" );

XmlDocument dom = new XmlDocument();
dom.Load( strm );

You should be able to do the same thing with a text file. I do this all the
time with icons and other images that my program uses.

Hope that helps.

Eric Renken
 

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

Top