1

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.

1
  • Can you post the solution? Thanks! Commented Sep 25, 2013 at 23:22

2 Answers 2

2
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);
}
Sign up to request clarification or add additional context in comments.

Comments

1
      var data = Properties.Resources.ResourceName;
       using(var stream = new FileStream(file, FileMode.Create))
       {
        stream.Write(data, 0, data.Count() - 1);
        stream.Flush();
       }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.