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);
}
}
我是一名优秀的程序员,十分优秀!