在运行时写入或读取Settings-Designer文件 [英] Writing to or reading from Settings-Designer file at runtime
本文介绍了在运行时写入或读取Settings-Designer文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
在设计时,可以很容易地在程序的设置选项卡中定义变量(可以从Project-> properties ...-> Settings访问).我需要知道的是,如何在运行时写入或读取关联文件(位于程序的属性文件夹中,在文件"Settings.settings"中或也称为"Settings-Designer"文件).你能帮我举个例子吗?
非常感谢
Hello,
At design time, one could easily define variables in setting tab (which could be accessed from Project -> properties... -> Settings) of program. What I need to know is, how to write to or read from the associated file (located at properties folder of program, in file "Settings.settings" or also called as "Settings-Designer" file) at runtime. Could you please help me through example?
Thanks a lot
推荐答案
我希望所有问题都和这个问题一样简单:):
http://msdn.microsoft.com/en-us/library/aa730869(VS .80).aspx [ ^ ]
欢呼声
I wish all questions were as easy as this one :) :
http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx[^]
Cheers
您可以通过Properties.Settings.Default
访问设置的属性,可以在其中读取或写入它们.如果您更改了它们并希望以后继续使用,请致电Properties.Settings.Default.Save();
You access the setting''s properties throughProperties.Settings.Default
where they can be read or written to. If you change them and wish to persist for future, callProperties.Settings.Default.Save();
这篇关于在运行时写入或读取Settings-Designer文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文