tags:

views:

183

answers:

2

I have a set of Folders(in Resources) which contains the Configuration files,I need to save this folder in the User's path.(if they don't have) for this reason only i added the Folders in Resources. Do anyone have any idea on how to save the Files in the Resources.

+2  A: 
using (System.IO.FileStream fs = new System.IO.FileStream(pathConfigurationFile, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write))
{
    byte[] data = Properties.Resources.YourConfigurationFile;
    fs.Write(data, 0, data.Length);
}
Kevin
Thanks :) . i got the Solution
DSB
+1  A: 
      var data = Properties.Resources.ResourceName;
       using(var stream = new FileStream(file, FileMode.Create))
       {
        stream.Write(data, 0, data.Count() - 1);
        stream.Flush();
       }
Adinochestva
Thanks :) . i got the Solution
DSB