SyncAgent.SyncStatistics 屬性
取得表示同步處理工作階段 (Session) 之統計資料的 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 方法,然後將資訊寫入主控台 (Console)。若要在完整範例的內容中檢視這段程式碼,請參閱使用者入門:用戶端與伺服器同步處理。
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)