我有以下 XML 文档:
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<Path> blahblahblah </Path>
<PathValue> blahblahblah </PathValue>
<domainName> blahblahblah </domainName>
<SuperUserEmail> blahblahblah </SuperUserEmail>
<SuperUserName> blahblahblah </SuperUserName>
<UserName> blahblahblah </UserName>
<Password> blahblahblah </Password>
<connectionstring>Data Source=ABC\SQLEXPRESS;Initial Catalog=mail;User ID=sa;Password=sa@</connectionstring>
</appSettings>
connectionstring
现在我必须从节点中提取整个路径。我尝试使用以下代码:
XmlNodeList xnList = xml.SelectNodes("/appSettings/connectionstring");
但它似乎不起作用。知道如何使它工作吗?