我尝试使用 C# 获取 XElement 的子节点值。XElement 块在下面。我的目的是在“c0”节点获取值。我怎样才能做到这一点?
// client is Orion SDK (SWIS) client.
XElement xe = client.QueryXml("select Uri FROM Orion.Pollers WHERE NetObjectID = 15", null);
XElement 结果块:
<queryResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.solarwinds.com/2007/08/informationservice">
<template>
<resultset>
<column name="Uri" type="String" ordinal="0" />
</resultset>
</template>
<data>
<row>
<c0>swis://solarwinds./Orion/Orion.Pollers/PollerID=55</c0>
</row>
<row>
<c0>swis://solarwinds./Orion/Orion.Pollers/PollerID=56</c0>
</row>
<row>
<c0>swis://solarwinds./Orion/Orion.Pollers/PollerID=57</c0>
</row>
<row>
<c0>swis://solarwinds./Orion/Orion.Pollers/PollerID=58</c0>
</row>
</data>
</queryResult>