共用方式為


SPDatabaseSnapshotCollection.CreateSnapshot Method

Creates a database snapshot of the current database.

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

Syntax

'Declaration
Public Function CreateSnapshot As SPDatabaseSnapshot
'Usage
Dim instance As SPDatabaseSnapshotCollection
Dim returnValue As SPDatabaseSnapshot

returnValue = instance.CreateSnapshot()
public SPDatabaseSnapshot CreateSnapshot()

Return Value

Type: Microsoft.SharePoint.Administration.Backup.SPDatabaseSnapshot
The database snapshot.

Remarks

The CreateSnapshot() method calls the RefreshSnapshots() method as part of its implementation.

If the EnabledManagement property has not been set to true or false, the CreateSnapshot() method sets to true; otherwise, it does not change the value of the EnabledManagement property. Enabling management makes possible automatic database snapshot creation and deletion by using a SharePoint timer job based on the settings in the CreationInterval, MaximumRetention, and SnapshotLimit properties. You can set the EnabledManagement property to false after calling the CreateSnapshot() method if you do not want this behavior. You would only have to do this after the first call of the CreateSnapshot() method.

See Also

Reference

SPDatabaseSnapshotCollection Class

SPDatabaseSnapshotCollection Members

Microsoft.SharePoint.Administration.Backup Namespace