Language: Visual Basic .NET
Note: This function is provided only for compatibility with 16-bit applications written for Windows. Applications should store initialization information in the registry.
-GetPrivateProfileString, MSDN Library (Jan 2006)
WRONG! Applications shouldn't store their settings in the registry. It centralizes application-specific data, making the reinstallation, copying, and settings tweaking of applications more cumbersome. For all of my programs, I use these "Windows 3.1 compatibility" functions to read/write settings to a .ini configuration file that can be placed in the directory with a program. They're actually far easier to use than the registry, too, and with minimal drawbacks. Over the years, I've been refining these functions with a wrapper module that makes accessing application settings even easier, which you can download here. It includes the following members: