After installing one of my .Net apps on a Windows 7 machine I keep getting an error that my application does not have permission to save a settings file to the application folder under the program files folder. I’m aware it’s possible to elevate to administrator privileges or whatever but I’d like to avoid this. I know Windows 7 and Vista have a particular location where they would like you to save settings files but I’m unsure of how to determine this location in .Net. Could anyone offer some assistance or suggestions? Thanks!
Share
You can use the Environment.SpecialFolder enumeration to return the various ‘special’ directories on the user’s system. You can use these as the parameters to the Environment.GetFolderPath method.