以下是代码:
ClientContext context = new ClientContext("http://SPSite");
context.Credentials = new NetworkCredential("user", "pwd", "domain");
ChangeQuery cq = new ChangeQuery(true, true);
ChangeCollection col = list.GetChanges(cq);
context.Load(col);
context.ExecuteQuery();
MessageBox.Show(col.Count.ToString());
无论所做的更改如何,它始终显示为0。
答案 0 :(得分:2)
ClientContext context = new ClientContext("http://SPSite");
context.Credentials = new NetworkCredential("user", "pwd", "domain");
ChangeQuery cq = new ChangeQuery(true, true);
cq.ChangeTokenStart = new ChangeToken();
cq.ChangeTokenStart.StringValue = "1;3;" + list.Id.ToString() + ";" + DateTime.UtcNow.AddHours(-1).Ticks.ToString() + ";-1";
ChangeCollection col = list.GetChanges(cq);
context.Load(col);
context.ExecuteQuery();
MessageBox.Show(col.Count.ToString());
即使我不喜欢自己创建令牌,但这似乎是迄今为止我用谷歌搜索工作的唯一方式。