开发者

how to enumerate the response set from FQL

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

I would like to convert response to

Li开发者_开发技巧st<long> uids


Assuming that the string returned is an 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);
      }
 } 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜