开发者

Updating app.config via xpath

开发者 https://www.devze.com 2023-03-21 00:18 出处:网络
Earlier I raised this question: Get attribute value from c#/xpath And the suggestions worked. However, I now need to update the actula document with a new value. I\'ve tried to set the value property

Earlier I raised this question: Get attribute value from c#/xpath

And the suggestions worked. However, I now need to update the actula document with a new value. I've tried to set the value property but this does not update the xml document (app.config in t开发者_开发问答his case). What would be the way to update an app.config?

Thanks


You'll want to open it with ConfigurationManager.OpenExeConfiguration

From there you probably should use the methods of the configuration object to change the settings, followed by a Save to save it to disk. But, if you really want to use the XPath methods, you could check the FilePath property and swap to munging it with xml tools.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号