本文介绍了更改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

推荐答案


<   ?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?



这篇关于更改Web.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 09:05