ReportingService2006.CreateResource 方法

定义

将新资源添加到 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

将包含资源的父文件夹的完全限定 URL。

Overwrite
Boolean

一个Boolean表达式,该表达式指定是否覆盖具有相同的名称和路径的现有资源。 默认值为 false

Contents
Byte[]

资源文件的内容。

MimeType
String

资源的 MIME 类型。 最大大小为 260 个字符。

Properties
Property[]

Property 对象的数组,它定义要为资源设置的属性名和属性值。

返回

一个用于新创建的资源的 CatalogItem 对象。

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头 (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
所需的权限 创建新资源: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>Parent

更新现有资源: <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> 打开 Resource

参数的 Parent 长度不能超过 260 个字符;否则,将引发 SOAP 异常,错误代码 为 rsItemLengthExceeded

参数 Parent 不能为 null 或空,也不能包含以下保留字符: : ? ; @ & = + $ , \ * > < | . "。 可以使用 /) (正斜杠字符分隔文件夹的完整路径名称中的项目,但不能在文件夹名称的末尾使用它。

如果发生错误,则不会创建资源。

将资源添加到 SharePoint 库会 ModifiedBy 修改父文件夹的 和 ModifiedDate 属性。

适用于