我想知道如何使用linq檢索XML,看起來完全一樣?在XML中檢索只有一個Int
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">20</int>
我應該使用linq嗎?我不知道這個熱門的號碼..
這是我嘗試使用的代碼,我stucj後選擇..有人可以幫助我嗎?
public void wc_DownloadTopFolder(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null)
{
try
{
// Retrieving the Top Folders
XDocument xdoc = XDocument.Parse(e.Result, LoadOptions.None);
int i = from query in xdoc.Descendants("int")
select new int
{
};
}
你在這一行只是有興趣更大的XML文件,或者那是你的xml文件的全部內容? – R0MANARMY 2012-04-19 13:41:03