Editing Web.config programmatically

前端 未结 7 1287
半阙折子戏
半阙折子戏 2020-12-03 21:57

What is a good way to edit a Web.config file programmatically?

I looked into System.Xml but couldn\'t find any obvious answers.

7条回答
  •  独厮守ぢ
    2020-12-03 22:26

    Depending on what you are doing, the method is really a bit different in each situation. However the most robust method is to load it as an XmlDocument and modify it as needed via that method, but you MUST be careful to only modify it in the needed manner.

提交回复
热议问题