在 My.Settings 中添加名称 [英] Add name in My.Settings

查看:41
本文介绍了在 My.Settings 中添加名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 My.Settings 中添加新名称?
到目前为止,我已经学会了如何读取和编辑其中的值,但如何在运行时添加另一行/名称?

How to add a new name in My.Settings?
So far, I've learned how to read and edit values in it, but how can I add another row/name at run-time?

类似于:

My.Settings.AddName.String("foo1")
My.Settings.Save()
My.Settings.foo1 = "fooNew"

我在网上看不到这样的..谢谢
用于动态添加按钮的名称、文本和位置.
SeeThisLink

I can't see such on the web.. Thanks
will be used for the name,text and location of dynamically added buttons.
SeeThisLink

推荐答案

My.Settings 应用程序设置被编译到您的程序集中.因此,无法在运行时更改属性.期望通过 My.Settings 属性在运行时可用的新设置是不可能的.您需要采用更基本的技术,例如 这个 MSDN 问题.

The My.Settings application settings are compiled into your assembly. The properties cannot be altered at runtime because of this. Expecting new settings to be available at runtime through the My.Settings property will not be possible. You would need to resort to more rudimentary techniques like those highlighted by this MSDN question.

这篇关于在 My.Settings 中添加名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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