如何读取xml的属性值。如何读取xml的属性值
我有这样的XML下面,我使用窗口形成vb.net
我想是这样的,但下面不工作。我想读的连接字符串值
Dim xe As XElement = XElement.Load("..\\..\\KMMiddleTier.xml")
Dim name = From nm In xe.Elements("ConnectionKey") Where nm.Element("ConnectionKey").Attribute("Key") = "DB_DEV" Select nm.Element("ConnectionKey").Attribute("ConnectionString").Value.FirstOrDefault()
[这个问题](http://stackoverflow.com/questions/15432185/retrieve-single-attribute-value-from-an-xml-doc-element)可能有帮助 –
我不想循环。我想要一个单一的字符串值 – user1030181