用户设置更改不可见

编程入门 行业动态 更新时间:2024-10-14 06:24:50
本文介绍了用户设置更改不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我添加了一些用户设置,在运行时更改它们并保存它们。 更改被接受所以当我再次启动程序时,变量会被更改(例如我更改了字符串,当我运行app时再次字符串被更改了。 问题是,当我查看设置时,总是会在开始时添加值,但是当我运行程序时,我有新的变量。 可以变量是保存的,以便我可以在用户设置中看到新的变量?

I added some user settings, change them in runtime and saved them. Change is accepted so when I start program again, variables are changed (for example I changed string, and when I run app again string is changed). Problem is when I look at the settings there are always values I added in begining, althoug when I run program I have new variables. Can variables be saves so that I can see new ones in user settings?

推荐答案

如果您使用应用程序范围进行设置,则无法在运行时更改设置。 其次,如果您通过在Visual Studio中编译从Debug目录运行,它将在每次编译和运行时用项目中的一个覆盖您的设置文件。这样做是因为它必须重新生成用于访问文件的Settings类。 If you are using the Application scope for your settings, the settings cannot be changed at run time. Second, if you are running from the Debug directory by compiling in Visual Studio, it will overwrite your settings file with the one from your project each time you compile and run. It does this because it has to re-generate the Settings class you use to access the file.

更多推荐

用户设置更改不可见

本文发布于:2023-11-24 00:18:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623289.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!