日期:2014-05-17 浏览次数:20747 次
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="SAP.Middleware.Connector">
<sectionGroup name="ClientSettings">
<section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration,sapnco"/>
</sectionGroup>
</sectionGroup>
</configSections>
<SAP.Middleware.Connector>
<ClientSettings>
<DestinationConfiguration>
<destinations>
<add NAME="Conn" USER="KY_PG01" PASSWD="ky@123" CLIENT="002" SYSNR="10" ASHOST="192.168.0.22" LANG="ZH" GROUP="PUBLIC" MAX_POOL_SIZE="5"></add>
</destinations>
</DestinationConfiguration>
</ClientSettings>
</SAP.Middleware.Connector>
</configuration>
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load("test.config");
XmlNode node = xmlDocument.SelectSingleNode("configuration/SAP.Middleware.Connector/ClientSettings/DestinationConfiguration/destinations/add");
Console.WriteLine(node.Attributes["NAME"].InnerText);//其它属性类似获取 这里输出Conn