c# Porperties.Settings的使用方法

使用Properites中的Settings可以很方便的添加配置

具体配置如下图:

 

读取配置值

String strAddress = Properties.Settings.Default.Address;

修改和保存配置(只针对用户配置)

Properties.Settings.Default.Address= "Address";

Properties.Settings.Default.Save();//使用Save方法保存更改

根据配置的Name获取Value

String strAddress = Properties.Settings.Default.Properties["Address"].DefaultValue

其中,Address大小写均可

posted on 2010-12-29 16:56  翔龙  阅读(571)  评论(2)    收藏  举报

导航