EWS. How to get latest SyncState without initial s

2019-04-06 23:56发布

问题:

Consider that I have 100,000 messages in a folder. I want to be able to synchronize with latest changes, but I don't need any old messages. Asking for initial synchronization with

SyncFolderItems(..., null /*syncState*/)? 

would bring back all 100,000 messages (that I don't need). How can I jump directly to the latest SyncState without reading 100,000 entities from server?

回答1:

You can't work around that. You need to iterate through the collection once. After you have processed all existing entries, the syncstate should be much smaller than your 143kb.