ReportingService2006.CreateResource 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增一個資源到 SharePoint 文件庫。
public:
ReportService2006::CatalogItem ^ CreateResource(System::String ^ Resource, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Contents, System::String ^ MimeType, cli::array <ReportService2006::Property ^> ^ Properties);
public ReportService2006.CatalogItem CreateResource(string Resource, string Parent, bool Overwrite, byte[] Contents, string MimeType, ReportService2006.Property[] Properties);
member this.CreateResource : string * string * bool * byte[] * string * ReportService2006.Property[] -> ReportService2006.CatalogItem
Public Function CreateResource (Resource As String, Parent As String, Overwrite As Boolean, Contents As Byte(), MimeType As String, Properties As Property()) As CatalogItem
參數
- Resource
- String
新資源的名稱。
- Parent
- String
包含該資源的父資料夾的完整限定網址。
- Overwrite
- Boolean
一個 Boolean 表達式,指定是否覆寫一個名稱與路徑相同的現有資源。 預設值為 false。
- Contents
- Byte[]
資源檔案的內容。
- MimeType
- String
資源的 MIME 類型。 最大字元長度為 260 字元。
傳回
一個 CatalogItem 用於新建立資源的物件。
備註
下表顯示此操作的標頭與權限資訊。
| SOAP 標頭 | (在) TrustedUserHeaderValue (出局) ServerInfoHeaderValue |
| 必要權限 | 建立新資源: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> on Parent更新現有資源: <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> 關於 Resource |
參數長度 Parent 不得超過 260 個字元;否則會拋出帶有錯誤碼 rsItemLengthExceed 的 SOAP 例外。
Parent參數不能為空或空,或包含以下保留字元: : ? ; @ & = + $ , \ * > < | . "。 你可以用斜線字元(/)來分隔資料夾完整路徑名稱中的項目,但不能用在資料夾名稱的末尾。
若發生錯誤,該資源不會被建立。
將資源加入 SharePoint 文件庫 會ModifiedBy修改父資料夾的 and ModifiedDate 屬性。