using System;
using Microsoft.SharePoint;
namespace Test
{
class ConsoleApp
{
static void Main(string[] args)
{
using (SPSite siteCollection = new SPSite("http://localhost"))
{
long total = 0;
SPChangeToken token = null;
while (true)
{
SPChangeCollection changes = siteCollection.GetChanges(token);
total += changes.Count;
// Break out of loop if we have the last batch
if (changes.Count < SPChangeCollection.CountLimit)
break;
// Otherwise, go get another batch
token = changes.LastChangeToken;
}
Console.WriteLine("{0:#,#} changes", total);
}
Console.Write("\nPress ENTER to continue...");
Console.ReadLine();
}
}
}