在C#中设置.config,.xml或注册表等文件中存储设置值的最佳方法是 [英] Which is the best way to store setting values in setting files like .config, .xml or registry in C#
问题描述
我想要实现的非常简单:我有一个Windows窗体(.NET 3.5)应用程序,它使用一个路径来读取信息。用户可以使用我提供的选项来修改此路径。我的应用程序将存储在每个客户端上,设置文件需要存储在远程服务器上。
现在,我想将路径值保存到文件中供以后使用,也可以远程访问。这将是保存到此文件的众多设置之一。这个文件将直接放在应用程序文件夹中。
我理解有三种选择:
ConfigurationSettings文件(appname.exe.config)
注册表
自定义XML文件
我已经看过关于这个问题的其他讨论,但我仍然不清楚。
我尝试了什么:
$ b $我正在尝试远程注册,但我仍有一些问题。
What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the options form I provide.My application will be stored on each client and setting files needs to be stored on remote server machine.
Now, I want to save the path value to a file for later use and accessed remotely also. This would be one of the many settings saved to this file. This file would sit directly in the application folder.
I understand three options are available:
ConfigurationSettings file (appname.exe.config)
Registry
Custom XML file
I have seen other discussions on this subject, but it is still not clear to me.
What I have tried:
i am trying remote registry but still i have some issues.
推荐答案
请参阅OriginalGriff的这篇优秀文章:< a href =https://www.codeproject.com/Tips/370232/Where-should-I-store-my-data>我应该在哪里存储我的数据? [ ^ ]。
See this excellent article by OriginalGriff: Where should I store my data?[^].
这篇关于在C#中设置.config,.xml或注册表等文件中存储设置值的最佳方法是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!