I've been asked to update a VB6 application that's been running on WinXP for the last 6 years. The client wants to use Windows 7. Up until now, the app stored its settings in an INI file located in the application directory. One key difference between XP and 7 is that you can't write to C:Program FilesAppFolder
anymore.
I am trying to figure out where on the file system should I store settings? Given that the application is still required to run on WinXP, I am kind of confused.
On WinXP, I have the following:
C:Documents and SettingsprofilenameApplication Data
C:Documents and SettingsprofilenameLocal SettingsApplication Data
On Windows 7, I have the following:
C:UsersprofilenameAppDataLocal
C:UsersprofilenameAppDataLocalLow
C:UsersprofilenameAppDataRoaming
Each one of these folders have subfolders that seem to store settings/files for various products
So 2 questions:
- Given all these folders, where do I store my settings?
- I am assuming that there is a nifty Windows API call that would give me the proper location of this folder. And I am hoping it works on both XP and 7. Is my assumption correct? If so, a link would be much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…