SyncAgent.SyncStatistics 属性
获取一个 SyncStatistics 对象,该对象表示同步会话的统计信息。
命名空间: Microsoft.Synchronization
程序集: Microsoft.Synchronization.Data(在 microsoft.synchronization.data.dll 中)
语法
声明
Public ReadOnly Property SyncStatistics As SyncStatistics
用法
Dim instance As SyncAgent
Dim value As SyncStatistics
value = instance.SyncStatistics
public SyncStatistics SyncStatistics { get; }
public:
property SyncStatistics^ SyncStatistics {
SyncStatistics^ get ();
}
/** @property */
public SyncStatistics get_SyncStatistics ()
public function get SyncStatistics () : SyncStatistics
属性值
一个 SyncStatistics 对象,表示同步会话的统计信息。
备注
同步统计信息用于记录,并用于在同步会话完成之后向用户显示摘要数据。
示例
下面的代码示例调用派生自 SyncAgent 的类的 Synchronize 方法,然后将信息写到控制台。若要在完整示例上下文中查看此代码,请参见入门:客户端与服务器同步。
SampleSyncAgent sampleSyncAgent = new SampleSyncAgent();
SyncStatistics syncStatistics = sampleSyncAgent.Synchronize();
Console.WriteLine("Start Time: " + syncStatistics.SyncStartTime);
Console.WriteLine("Total Changes Downloaded: " + syncStatistics.TotalChangesDownloaded);
Console.WriteLine("Complete Time: " + syncStatistics.SyncCompleteTime);
Console.WriteLine(String.Empty);
Dim sampleSyncAgent As New SampleSyncAgent()
Dim syncStatistics As SyncStatistics = sampleSyncAgent.Synchronize()
Console.WriteLine("Start Time: " & syncStatistics.SyncStartTime)
Console.WriteLine("Total Changes Downloaded: " & syncStatistics.TotalChangesDownloaded)
Console.WriteLine("Complete Time: " & syncStatistics.SyncCompleteTime)
Console.WriteLine(String.Empty)