linqtoxmlによってこのxmlファイルを選択ip
して要素を形成する方法port
<?xml version="1.0" encoding="utf-8"?>
<settings>
<IncomingConfig>
<ip>10.100.101.18</ip>
<port>5060</port>
</IncomingConfig>
<Device>
<username>tarek</username>
<AgentName>tarek</AgentName>
<password>ffff</password>
</Device>
<Device>
<username>adf</username>
<AgentName>adf</AgentName>
<password>fadsf</password>
</Device>
</settings>
そして私はこのコードを書きますが動作しません
XDocument doc = XDocument.Load(CONFIGURATION_FULL_PATH);
var port = int.Parse(doc.XPathSelectElement("port").Value);
var localIpAdres = doc.XPathSelectElement("ip").Value;