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
2009-07-16 11:48:13
Thanks :) . i got the Solution
DSB
2009-07-17 09:11:06
+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
2009-07-16 11:53:01