2013-08-26 24 views

回答

0

您可以使用XDocumentLINQ-to-XML):

Dim url As String = XDocument.Load(new StringReader("<Image><URL scope=\"public\" type=\"string\" value=\"image URL\"/></Image>")).Descendants("URL").Attribute("value").Value 

Check the XDocument.Load(TextReader) method overload documentation.

+0

我的XML存儲爲一個字符串。當我使用字符串變量作爲加載參數時,它會拋出錯誤 - '屬性'不是'System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)'的成員。我也是網絡發展的新手。 – Aniruddha

+0

@Aniruddha哎呀,你說得對錯。讓我糾正它;) –

+0

@Aniruddha現在嘗試更新的解決方案! –