On Mar 6, 11:27 am, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.com> wrote:
> > > You can add them to your project, set Build Action to "Content" and the
> > > "Copy to Output Dir" to "Copy Always". Then you can load it by its relative
[quoted text clipped - 31 lines]
> Then set the "Build Action" to "Embedded Resource". Do you mean the
> filenames change every build or the file contents change every build?
Yes that is correct. So here is what I am planning to do
1. All the input files required will be staged in a temp folder for
me. So I will have one program which will read each file and create a
console c# program to add it to a resource file. This step only
creates an output c# program.
2. Now I run command line compiler to build and then run the program.
The output will be a resource file.
3. Now build my actual program which expects all the files in resource
file to run at the destination with the resource file created at step
2.
4. Copy the final exe to destination server and run it.
I got al step 2, 3 and 4 except the part where how to add a file to a
resource file and read a file from resource file. All the example I
have seen so far are image files. I couldn't find single example for
adding a text/binary file to a resource file.
So if someone can help me on how to write a text file to resource file
and read the text file back from resource file, it would be greatful.
Thanks again.
Family Tree Mike - 07 Mar 2008 13:56 GMT
> On Mar 6, 11:27 am, Family Tree Mike
> <FamilyTreeM...@discussions.microsoft.com> wrote:
[quoted text clipped - 55 lines]
>
> Thanks again.
The process for adding the files as a resource should be the same whether
the file is a bitmap/jpeg/tiff or the text of "War and Peace". You get the
files out at runtime with GetManifestResourceStream and read it with a
StreamReader, rather than sending it to the constructor for an image.