Sign in to follow this  
Wibbs

[C#] Question about where to save different types of file on users computer

Recommended Posts

Hi all,

I am working on a game where the user will be required to download content of different types, and I would like to ask for clarification on where the best place is to save this information.

There will be both official and user made game levels, and I am a little unsure of where to save them. At present they are going into a folder in:
C:\Documents and Settings\All Users\Application Data
which I am accessing through:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)

I have a couple of queries:
Are all users guaranteed to be able to access this folder for reading and writing?
Would it be preferable to save to the specific users application data folder? If so then is it OK to expect each windows user account to have to download content seperately?
I am using Windows XP. Are there any variations in practice between this, Vista and Windows 7?

Thanks in advance for your help.

Phil

Share this post


Link to post
Share on other sites
Application Data is designed entirely around being unrestricted so applications have a centralized place to read and write data, since apps often don't have permission to modify data in their own directory.

Storing stuff in AppData is the preferred way to store data for XP, Vista, and Win7.

Share this post


Link to post
Share on other sites
Cool thanks - would it preferable to use the shared app directory or the user specific one?

[Edited by - Wibbs on November 30, 2010 5:29:17 AM]

Share this post


Link to post
Share on other sites
Another friendlier option is to actually ask the user. Consider a user that installs your program on a drive other than C: (for whatever reason - maybe the C drive is getting full).

Share this post


Link to post
Share on other sites
Quote:

Cool thanks - would it preferable to use the shared app directory or the user specific one?

If the settings are application specific, use the application directory. If they are user specific, use the user directory. You can use both if needed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this