SPBackupRestoreConsole.CreateBackupRestore method (SPBackupRestoreSettings, Boolean)
會建立備份或還原作業,並將其指派的識別碼。
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Function CreateBackupRestore ( _
settings As SPBackupRestoreSettings, _
showTree As Boolean _
) As Guid
'用途
Dim settings As SPBackupRestoreSettings
Dim showTree As Boolean
Dim returnValue As Guid
returnValue = SPBackupRestoreConsole.CreateBackupRestore(settings, _
showTree)
public static Guid CreateBackupRestore(
SPBackupRestoreSettings settings,
bool showTree
)
參數
settings
Type: Microsoft.SharePoint.Administration.Backup.SPBackupRestoreSettings設定備份或還原作業的圖樣。
showTree
Type: System.Boolean指出的樹狀目錄中的元件,而不是實際的備份/還原作業 ; 應該要列印的true否則false。
傳回值
Type: System.Guid
Guid 識別新的備份或還原作業。
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | settings是a null reference (Nothing in Visual Basic)。 |
SPException | 備份或還原已排程的元件。 |
備註
備份或還原作業是SPBackupRestoreConsoleObject物件。會傳回Guid是您的程式碼可以參照作業時,它會呼叫SPBackupRestoreConsole的要徑成員的主要方法。例如,您可以使用Guid做為SetActive、 Run,以及Remove方法的參數。
如果您想要取得SPBackupRestoreConsoleObject物件的直接參考,請使用Get。
CreateBackupRestore方法也會建立具有相同的識別碼,做為SPBackupRestoreConsoleObject物件SPBackupRestoreHistoryObject物件。