SPExport class
支援將匯出的指定內容從來源SharePoint Foundation網站集合 CAB 檔案 (副檔名.cmp 檔案),以 XML 格式。
Inheritance hierarchy
System.Object
Microsoft.SharePoint.Deployment.SPDeployment
Microsoft.SharePoint.Deployment.SPExport
Namespace: Microsoft.SharePoint.Deployment
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPExport _
Inherits SPDeployment
'用途
Dim instance As SPExport
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPExport : SPDeployment
備註
與其他類別支援匯入、 匯出、 發佈及移轉 Windows SharePoint 內容,以及支援的備份與還原功能Deployment命名空間中有參與此類別。
您可以啟動匯出作業先初始化具有必要的匯出設定Microsoft.SharePoint.Deployment.SPExportSettings類別的執行個體,然後SPExportSettings物件傳遞至SPExport類別 ; 建構函式您呼叫SPExport.Run方法。
Examples
下列程式碼範例會示範如何執行完整的匯出的整個網站集合。
[C#]
SPExportSettings settings = new SPExportSettings();
settings.SiteUrl = "https://servername:80";
settings.FileLocation = @"c:\exportdata";
settings.BaseFileName = "exportfile.cmp";
settings.FileCompression = true;
settings.ExportMethod = SPExportMethodType.ExportAll;
SPExport export = new SPExport(settings);
export.Run();
下列程式碼範例會示範如何執行累加匯出。請注意程式碼將ExportMethod屬性設定為ExportChanges ,然後將變更 token。
[C#]
settings.ExportMethod = SPExportMethodType.ExportChanges;
settings.ExportChangeToken = "1;1;87a71761-2987-48eb-9d29-48428270e01;632937036861200000;5512";
Thread safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.