开发者

Updating app.config via xpath

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜