When using a Settings.settings file in .NET, where is the config actually stored?

后端 未结 10 709
予麋鹿
予麋鹿 2020-11-29 16:03

When using a Settings.settings file in .NET, where is the config actually stored? I want to delete the saved settings to go back to the default state, but can\'t find where

相关标签:
10条回答
  • 2020-11-29 17:03

    It is in a folder with your application's name in Application Data folder in User's home folder (C:\documents and settings\user on xp and c:\users\user on Windows Vista).

    There is some information here also.

    PS:- try accessing it by %appdata% in run box!

    0 讨论(0)
  • 2020-11-29 17:06

    All your settings are stored in the respective .config file.

    The .settings file simply provides a strongly typed class for a set of settings that belong together, but the actual settings are stored in app.config or a .config file in your application.

    If you add a .settings file, an app.config will be automatically added to house the settings if you don't already have one.

    0 讨论(0)
  • 2020-11-29 17:08

    It depends on whether the setting you have chosen is at "User" scope or "Application" scope.

    User scope

    User scope settings are stored in

    C:\Documents and Settings\ username \Local Settings\Application Data\ ApplicationName

    You can read/write them at runtime.

    For Vista and Windows 7, folder is

    C:\Users\ username \AppData\Local\ ApplicationName

    or

    C:\Users\ username \AppData\Roaming\ ApplicationName

    Application scope

    Application scope settings are saved in AppName.exe.config and they are readonly at runtime.

    0 讨论(0)
  • 2020-11-29 17:08

    I know it's already answered but couldn't you just synchronize the settings in the settings designer to move back to your default settings?

    0 讨论(0)
提交回复
热议问题