Simple question here. I have a C# program which needs to stores some files onto the hard drive, but I don't need them to be anywhere useful to the end-user, only somewhere that the program can read/write from.
Is there a directory that I can reference programmatically to be my "filespace playground" - that is, that I can read/write freely to and from?
EDIT: Also, if I use a temp directory, how long are the files guaranteed to be there? I don't want the them to disappear while my program is still running!
I would use the Application Data Directory. You can get to it using something like:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
It is the prefered location in windows for application specific data and it is generally hidden from the user unless they would like to go and find 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