将My.Settings导出到文件 [英] Exporting My.Settings to file

查看:111
本文介绍了将My.Settings导出到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种方法来获取我存储在VB.Net My.Settings区域中的许多设置,并将它们导出到可以在需要时再次导入的文件.

我使用它们来存储共享文件上的客户数据,所以ADO出局了.

在此先感谢您的帮助!!!

I am trying to find a way to take the MANY settings I have stored in the My.Settings area of VB.Net and export them to a file that I can Import again when needed.

I am using them to store customer data that is on a shared file, so ADO is out.

Thanks in advance for any help!!!!

推荐答案

我更喜欢使用 Data Contract .请参阅:
http://msdn.microsoft.com/en-us/library/ms733127.aspx [ ^ ].

是的,我了解应用程序设置.请参阅 http://msdn.microsoft.com/en-us/library/ms973902.aspx [ ^ ].

是的,您可以使用上面引用的文章中描述的方法.

我仍然认为Data Contract更灵活且非侵入性.它可与基于任意数据类集生成的任何对象图一起使用.该图甚至可以是非分层的.而且,该方法是通用的,并且非常易于使用.另一个重要的事情是在软件进行演进时提供向后兼容性.

请参阅我过去提倡数据合同的文章:
如何在我的表单应用程序? [ ^ ],
创建属性文件... [反序列化json字符串数组 [
I prefer using Data Contract. Please see:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].

Yes, I know about Application Settings. See http://msdn.microsoft.com/en-us/library/ms973902.aspx[^].

Yes, you can use the approach described in the article referenced above.

I still thing Data Contract is more flexible and non-intrusive. It can be used with any objects graphs generated based on any arbitrary set of data classes. The graph can even be non-hierarchical. Also, the approach is universal and extremely easy to use. Another important thing is the provision for backward compatibility when the software goes through evolution.

Please see my past articles advocating Data Contract:
How can I utilize XML File streamwriter and reader in my form application?[^],
Creating property files...[^],
deseralize a json string array[^].

—SA


这篇关于将My.Settings导出到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆