我有一个代码:
List<Songs> song;
ServiceBaiHat.MywebserviceSoapClient service = new ServiceBaiHat.MywebserviceSoapClient();
service.getListCatalogAsync();
service.getListCatalogCompleted+=service_getListCatalogCompleted;
private void service_getListCatalogCompleted(object sender, ServiceBaiHat.getListCatalogCompletedEventArgs e)
{
if (e.Result != null)
{
XElement element = XElement.Parse(e.Result.ToString());
listbaihat = (from p in element.Descendants("songs")
select new Songs
{
name = (string)p.Element("name"),
link = (string)p.Element("link"),
album = (string)p.Element("album")
}).ToList<Songs>();
}
}
现在,为什么在element.Descendants(&#34;歌曲&#34;)上有错误???