In .NET, how should I get access to a folder for holding configuration data specific to the current machine or user (to avoid hard-coding a path)?
Question answered... by the way, here's typical WinXP output of
foreach (Environment.SpecialFolder f in
Enum.GetValues(typeof(Environment.SpecialFolder)))
Debug.WriteLine(string.Format("{0,16}: {1}",
f.ToString(), Environment.GetFolderPath(f)));
Desktop: C:\Documents and Settings\user\Desktop Programs: C:\Documents and Settings\user\Start Menu\Programs Personal: C:\Documents and Settings\user\My Documents Personal: C:\Documents and Settings\user\My Documents Favorites: C:\Documents and Settings\user\Favorites Startup: C:\Documents and Settings\user\Start Menu\Programs\Startup Recent: C:\Documents and Settings\user\Recent SendTo: C:\Documents and Settings\user\SendTo StartMenu: C:\Documents and Settings\user\Start Menu MyMusic: C:\Documents and Settings\user\My Documents\My Music DesktopDirectory: C:\Documents and Settings\user\Desktop MyComputer: Templates: C:\Documents and Settings\user\Templates ApplicationData: C:\Documents and Settings\user\Application Data LocalApplicationData: C:\Documents and Settings\user\Local Settings\Application Data InternetCache: C:\Documents and Settings\user\Local Settings\Temporary Internet Files Cookies: C:\Documents and Settings\user\Cookies History: C:\Documents and Settings\user\Local Settings\History CommonApplicationData: C:\Documents and Settings\All Users.WINDOWS\Application Data System: C:\WINDOWS\system32 ProgramFiles: C:\Program Files MyPictures: C:\Documents and Settings\user\My Documents\My Pictures CommonProgramFiles: C:\Program Files\Common Files