c# asp.net 修改webconfig文件 配置

2021-08-08 10:56

阅读:784

标签:修改   asp   date   add   asp.net   summary   name   判断   nbsp    #region 修改config文件 /// /// 修改config文件(AppSetting节点) /// /// 键 /// 要修改成的值 public static void UpdateAppSetting(string key, string value) { XmlDocument doc = new XmlDocument(); //获得配置文件的全路径 string strFileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Web.config"; doc.Load(strFileName); //找出名称为“add”的所有元素 XmlNodeList nodes = doc.GetElementsByTagName("add"); for (int i = 0; i


评论


亲,登录后才可以留言!