gpt4 book ai didi

c# - 如何从 FQL 枚举响应集

转载 作者:太空宇宙 更新时间:2023-11-03 16:52:40 26 4
gpt4 key购买 nike

var response = _facebookAPI.Fql.Query(String.Format("SELECT uid FROM event_member WHERE eid={0}", myevent));

我想将响应转换为

List<long> uids

最佳答案

假设返回的字符串是一个 XMLDocument:

var response = _facebookAPI.Fql.Query(String.Format("SELECT uid FROM event_member WHERE eid={0}", myevent));
XmlDocument doc = new XmlDocument();
doc.LoadXml(response);
XmlNodeList uids = doc.GetElementsByTagName("uid");

var uids = new List<long>();
foreach (XmlNode node in uids)
{
long id;
if (long.TryParse(node.InnerText, out id))
{
uids.Add(id);
}
}

关于c# - 如何从 FQL 枚举响应集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3396220/

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