[fix]Config创建默认配置文件的开关Runtime.CreateConfigOnMissing,仅需对自动创建生效,而不应该阻止用户主动Save
智能大石头 authored at 2024-08-09 00:30:41 石头 committed at 2024-08-10 14:22:24
711.00 B
X
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class Admin_System_WebConfig : MyEntityList
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String file = Server.MapPath("~/web.config");
            txtLog.Text = File.ReadAllText(file);
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        String file = Server.MapPath("~/web.config");
        String str = File.ReadAllText(file);
        if (txtLog.Text == str) return;

        File.WriteAllText(file, txtLog.Text);
    }
}