更改Web.Config [英] Changing a Web.Config
本文介绍了更改Web.Config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在将Web.Config加载到XmlDocument中.已成功读取.
Hello,
i am loading a Web.Config into a XmlDocument. It is successfully read.
System.Xml.XmlElement Root = xmlDocument.DocumentElement;
System.Xml.XmlNode node = Root.SelectSingleNode("//appSettings/add[@key=''ipAdresseWebServer'']");
之后,"Root"具有正确的"configuration"值,但"node"始终保持为"null":/
我只是找不到问题.
问候Tobi
after that, "Root" has the value "configuration" which is right, but "node" always stays "null" :/
I just can''t find the problem.
Greetings Tobi
推荐答案
这告诉我您的参数有问题.
This tells me there''s something wrong with your parameter.
是的,他没有.找不到节点.
XML看起来像这样:
Thats right, he doesn''t find the node.
The XML looks like this:
< ?xml version="1.0"?>
< configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
< appsettings>
< add key="ipAdresseWebServer" value="XXX.XXX.XXX.XXX:XX" />
< /appsettings>
< /configuration>
那么怎么了?
So whats wrong?
XML区分大小写. (appsettings
与appSettings
)
XML is case sensitive. (appsettings
vs.appSettings
)
这篇关于更改Web.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文