c# - 通过linq获取乘法结果

标签 c# linq youtube

我对linq有问题,我想从youtube xml中获得乘法结果,但是这段代码仅给我一个结果,有人知道如何解决此问题?

key = @"http://gdata.youtube.com/feeds/api/videos?q="+keys+@"&orderby=relevance";
var youtube = XDocument.Load(key);
var urls = (from item in youtube.Elements("{http://www.w3.org/2005/Atom}feed")
                select new
                {
                    soundName = item.Element("{http://www.w3.org/2005/Atom}entry").Element("{http://www.w3.org/2005/Atom}title").ToString(),
                    url = item.Element("{http://www.w3.org/2005/Atom}entry").Element("{http://www.w3.org/2005/Atom}id").ToString(),
                });

youtube xml:
http://gdata.youtube.com/feeds/api/videos?q=keyword&orderby=relevance
感谢帮助!

最佳答案

    var urls = (from item in youtube.Element("{http://www.w3.org/2005/Atom}feed").Descendants("{http://www.w3.org/2005/Atom}entry")
                select new
                {
                    soundName = item.Element("{http://www.w3.org/2005/Atom}title").ToString(),
                    url = item.Element("{http://www.w3.org/2005/Atom}id").ToString(),
                });

关于c# - 通过linq获取乘法结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20031912/

相关文章:

javascript - 通过YouTube API动态添加/循环播放多个视频,播放器名称和事件?

c# - 测试接口(interface)实现是好的设计吗?

c# - 对 List<string> 进行排序,如 Excel 列排序

c# - LINQ to Entities - 解析/过滤对象集合

c# - 如何获得 Expression.Lambda<Func<T, bool>> 泛型

javascript - 如何获得按地区列出当天观看次数最多的YouTube视频的列表?

c# - 开始使用 language.ext(函数式 C#)

c# - 未知的鉴别器值 C# Mongo

C# 自定义 Linq 提供程序

c# - 如何使用 YouTube .NET API 投票/点赞评论?