用户设置:我的选择是什么?
当我要使用用户(持久)设置时,我试图找出我的选择。
在 vs Studio 中,这在项目的属性中是可能的,但我逐渐了解其中的限制:
仅允许可转换为字符串的值。
无法保存集合(例如,列表框中的项目,具有名称和值)。
我想知道的是,如何通过集合实现用户设置,以及如何进行用户设置?
埃默里恩
I'm trying to find out what my choices are when I'm going to use user (persistent) settings.
In vs Studio this is possible in the properties of your project but I'm getting to know the limits there:
Only values are allowed that can be converted to string.
Collections (e.g items in a Listbox, with a name and value) cannot be saved.
What I would like to know, how do you implement user settings with collections, and how do you make user settings?
Emerion
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确,我认为您可能正在寻找
序列化
,并且由于您提到了无法转换为字符串的值,我假设您可能需要二进制序列化。System.Runtime.Serialization 命名空间包含可帮助这篇文章可能对您有用:.NET Framework 中的序列化
If I understand correctly I think you're probably looking for
serialization
, and since you mention values that can't be converted to string I assume that you'd probably want binary serialization.The System.Runtime.Serialization namespace contains classes to help you with this and here's an article that might be useful: Serialization in the .NET Framework