How can I check if IncomingConfig
element exists by use linq to xml?
<?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>
bool b = xdocument.Descendants("IncomingConfig").Any();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With