共用方式為


SPDatabaseSnapshotCollection.MaximumRetention property

取得或設定時間,以小時,會自動在刪除之前,儲存資料庫快照集。

Namespace:  Microsoft.SharePoint.Administration.Backup
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Property MaximumRetention As Short
    Get
    Set
'用途
Dim instance As SPDatabaseSnapshotCollection
Dim value As Short

value = instance.MaximumRetention

instance.MaximumRetention = value
public short MaximumRetention { get; set; }

Property value

Type: System.Int16
資料庫快照集以小時為單位的壽命。

Exceptions

Exception Condition
ArgumentOutOfRangeException

嘗試將指派給此屬性的值大於 500 或負數。

備註

MaximumRetention無法設定為超過 500。

如果EnabledManagementfalse,則會由內建資料庫快照集管理系統的SharePoint Foundation忽略MaximumRetention屬性。

您必須先呼叫Update()變更儲存至這個屬性。

Examples

在下列範例中, db是SPDatabase物件。

db.Snapshots.MaximumRetention = 24; db.Update();

請參閱

參照

SPDatabaseSnapshotCollection class

SPDatabaseSnapshotCollection members

Microsoft.SharePoint.Administration.Backup namespace