You can get the stream as follows:
Stream inFile =
Assembly.GetExecutingAssembly().GetManifestResourceStream("YourNameSpace.You
rXmlFileName.xml");
From here, you simply need to create an output stream and copy the data.
Pete
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have an XML file that I want to embed in my exe. It is a default config
> file, that my program should read from and recreate it on the user's hard
> disk the first time the application is run or if they corrupt their config
> file.
>
> So I created a default.config file (XML file) and set its Build Action
> property to "Embedded Resource".
>
> What is the code to read the embedded default.config and recreate it on
the
> user's hard disk?
>
> Thanks.
>
>
|