Initializing user.config or app.exe.config during install

前端 未结 3 1811
醉酒成梦
醉酒成梦 2021-02-20 07:25

I am developing a .NET WinForms application which relies on user.config to store various useful settings such as intranet web service URLs. We would like to make it possible to

3条回答
  •  天命终不由人
    2021-02-20 08:11

    If it is acceptable for you to hardcode at least one setting in the config file, you can use this to point to a database or web service or network file path where all the custom config settings can be stored. Using System.Configuration.ConfigurationManager.OpenExeConfiguration() you can then update the config file from this location either on the first run or every time that the application starts up.

提交回复
热议问题