I am creating an application that uses photos and an XML file all in one folder that I am creating manually, I want to let the user update the data of that folder (Adding Photos, and Editing the Xml file) at run time via the application my question is what is the best approach and where to put that Folder, I know I have to put that relative paths so I am confiused is it in the AppData if so how to do it.
// Use this to get the common directory
string CommonDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
// And combine it with your own.
// On Window7 this will return "c:\ProgramData\YourCompany\YourProduct"
string YourDir = Path.Combine(CommonDir, @"YourCompany\YourProduct");
// And create the directory / ensure it exists
System.IO.Directory.CreateDirectory(YourDir);
There are other Special Folders you can get from the system, such as MyDocuments
or Desktop
as fits your needs best.
first right click on your project explorer and add new folder, it displays empty folder and you put this files into it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With