newbie question

H

HockeyFan

I have an IO.Stream that I get from an embedded resource file. I
called GetManifestResourceStream.
This stream is that of a Word template doc. I'd like to write this to
disk.
If my embedded resource stream is called 'wordstream', how do I take
this and write it to disk so that it can be used as a Word template?
 
J

Jon Skeet [C# MVP]

HockeyFan said:
I have an IO.Stream that I get from an embedded resource file. I
called GetManifestResourceStream.
This stream is that of a Word template doc. I'd like to write this to
disk.
If my embedded resource stream is called 'wordstream', how do I take
this and write it to disk so that it can be used as a Word template?

Open a FileStream to write to, and then repeatedly read from wordstream
(into a byte array) and write to the file stream until Read returns 0.
 

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