Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在C中使用linq从xml中读取特定字段值#_C#_Linq - Fatal编程技术网

C# 如何在C中使用linq从xml中读取特定字段值#

C# 如何在C中使用linq从xml中读取特定字段值#,c#,linq,C#,Linq,这是我试图阅读的xml 在下面给定的xml中,我想阅读“customfieldvalue”,其中customfieldname=“Fixed In Build” 我也尝试过不同的方法来获得结果,但是没有用 一些boby在这方面帮助了我。customfields不在示例中,但我猜它是围绕此的节点。你可能需要丢掉一个“s”: //.Descendants("customfields") .Descendants("customfield") .Where(...) 或者,当您想更精确地了解

这是我试图阅读的xml

在下面给定的xml中,我想阅读“customfieldvalue”,其中customfieldname=“Fixed In Build”

我也尝试过不同的方法来获得结果,但是没有用


一些boby在这方面帮助了我。

customfields
不在示例中,但我猜它是围绕此的节点。你可能需要丢掉一个“s”:

//.Descendants("customfields")
  .Descendants("customfield")
  .Where(...)
或者,当您想更精确地了解XML结构时:

 .Descendants("customfields")
 .Elements("customfield")
 .Where(...)
//.Descendants("customfields")
  .Descendants("customfield")
  .Where(...)
 .Descendants("customfields")
 .Elements("customfield")
 .Where(...)