?
Solved

where to store app data

Posted on 2011-04-20
4
Medium Priority
?
280 Views
Last Modified: 2013-12-16
Hi Experts,
I have a data file that I used to store in the program files directory branch of my application.  But of course now in Windows 7, I can't write to this file because of permissions.  There must be a place where these settings can be saved to a file with minimal worry about rights?  What is the correct way/place to do this?   (location for app data and what API call to find the location?)

Thanks!
Mike
0
Comment
Question by:thready
  • 2
4 Comments
 
LVL 9

Assisted Solution

by:xav056
xav056 earned 400 total points
ID: 35433966
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
That is the AppData under user profile
0
 
LVL 1

Author Comment

by:thready
ID: 35433988
What about for all users?
0
 
LVL 9

Expert Comment

by:xav056
ID: 35434178
that would be application setting
My.Setting.SettingName
check this out
http://www.codeproject.com/KB/vb/appsettings2005.aspx
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1600 total points
ID: 35434273
See: http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

ApplicationData = The directory that serves as a common repository for application-specific data for the current roaming user.
CommonApplicationData = The directory that serves as a common repository for application-specific data that is used by all users.
LocalApplicationData = The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The PowerShell Core 6.0 of .NET release is just the beginning. The upcoming PowerShell Core 6.1 would have artificial intelligence and internet of things capabilities. So many things to look forward to in the upcoming release.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question