开发者

C# System.Configuration.Configuration Import/Export

I use the System.Configuration.Configuration to save many user settings. I want to allow the user to export some of the settings, and import them later (or in other instance of the program). However, I didn't find a way to do it (save a file that contains only a subset of the configuration sections, and then load this sections to the system).

Is there a way in C# to import and export p开发者_运维知识库arts of the configuration?


Using the default behavior of Microsoft .NET application settings architecture, specific user data is stored in a file named user.config, stored under the user's home directory. This is documented here.

For exporting the entire user settings collection you would just need to store the contents of that file. In order to export only some of the settings you can always read only the desired settings, i guess.

This article may also be useful, Application Settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜