gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 05:27:55 24 4
gpt4 key购买 nike

我对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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com