Re: Registry verses INI
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 22:30:09 -0400
"Brian" <bkstigler@xxxxxxx> wrote in message news:%23pLAx2w8GHA.4288@xxxxxxxxxxxxxxxxxxxxxxx
I've seen various post suggest that an INI file is preferred to using the registry for saving application configuration data. My question is this... If a user doesn't have admin rights on the PC, where is the best place to store the INI file?
With the registry, I can tell the app to write to the HKEY_CURRENT_USERS area. So wouldn't this be a better place to store configuration data when a user has limited rights?
Just trying to get some clarification on this issue before driving down one path or the other. The data I need to store isn't too extensive... just a handful of items and parameters.
There's no cut and dry answer to that. Blame Microsoft for changing "standards" and not even following their own "suggested standard". When Win95 first came out, MS said "Don't use INI files anymore. Use the Registry". 11 years later, Microsoft STILL uses INI files an awful lot.
Bottom line is that it's up to you. Many people are against using the Registry because it just bloats it. Other programmers prefer one or the other for various reasons....and some use both depending on the circumstances.
If you use an INI file, though, you do have to be careful about where you write it. If you use the Win32API functions for writing INI files, I *believe* write permissions are inherent. But don't quote me on that. Personally, I'm one of those that sometimes uses INI files and sometimes uses the Registry. When I use INI files, I either write them to that user's Application Data folder or the "All Users" Application Data folder(depending on whether the saved settings should apply to all users or just that user). To get the path to either folder, use the SHGetSpecialFolderPath Win32 API function.
--
Mike
Microsoft MVP Visual Basic
.
- Follow-Ups:
- Re: Registry verses INI
- From: Brian
- Re: Registry verses INI
- References:
- Registry verses INI
- From: Brian
- Registry verses INI
- Prev by Date: Re: Screen Size
- Next by Date: Re: I dont know how to link VB to database (ODBC) table.
- Previous by thread: Re: Registry verses INI
- Next by thread: Re: Registry verses INI
- Index(es):
Relevant Pages
|