Use "ApplicationData" or "LocalApplicationData" to store a file common to all users?

Summary: Several different users will use my application on a specific machine. I want the application to store its data in one common file on this computer, regardless of which user launches the application.

To achieve what I want, I wonder if this question might be relevant: The difference between 'SpecialFolder.LocalApplicationData' and 'SpecialFolder.ApplicationData'?

From this question and its answers it is clear that:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) 

specific to the car. Some of the information I received from googling confirms this. However, I also found information that LocalApplicationData is user-specific.

So what is right? And can someone tell me what “user-specific” and “specific computer” really mean?

Here's what I think: if LocalApplicationData is a machine, then I can use this as a basis so that my application saves all its data in one common file for all users.

I am also interested to know about the ApplicationData folder:

 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 

Should I use ApplicationData to get what I want?

+8
source share
1 answer

Both ApplicationData and LocalApplicationData are available only to the currently logged in user. The difference between the two is that ApplicationData replicated and synchronized with other devices that the user uses in the corporate environment. This will be used to store user settings.

As Raymond suggested ( see Docs ), you'll want to use a different folder. CommonDocuments would be a good option for documents that would be available to all users. CommonMusic if you store music and so on ...

If you want to store application files, use:

 Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) 
+6
source

All Articles