62,046
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
SetAppSetting("del_flag", "1");
}
}
private void SetAppSetting(string key, string val)
{
Configuration config = WebConfigurationManager.OpenMachineConfiguration(地址);
string strExists = "";
try
{
strExists = config.AppSettings.Settings[key].Value;
}
catch
{
}
if (strExists == "")
{
config.AppSettings.Settings.Add(key, val);
}
else
{
config.AppSettings.Settings[key].Value = val;
}
config.Save();
}