using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;namespace WindowsApplication2
{
sealed class ProjectSettings : ApplicationSettingsBase
{
public ProjectSettings()
{
}
[UserScopedSettingAttribute()]
[DefaultSettingValue("12.5")]
public double RichTextLeftMargin
{
get { return (double)this["RichTextLeftMargin"]; }
set { this["RichTextLeftMargin"] = value; }
}
}
} ProjectSettings setting = new ProjectSettings();
private void button1_Click(object sender, EventArgs e)
{
//读取左边据
Console.WriteLine("左边距:"+setting.RichTextLeftMargin); }
private void button2_Click(object sender, EventArgs e)
{
//改变并保存
setting.RichTextLeftMargin = 11;
setting.Save();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货