public void writeConfig(string name, string ConnectionString)
{
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);
ConnectionStringsSection con = (ConnectionStringsSection)config.GetSection("connectionStrings");
con.ConnectionStrings[name].ConnectionString = ConnectionString;
Response.Write("<script>alert ('成功');</script>");
config.Save();
}