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

  • Thread starter Thread starter vjunkl
  • Start date Start date
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
 
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
 
Back
Top