ReportingService2006.CreateFolder(String, String) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Aggiunge una cartella a una raccolta di SharePoint.
public:
ReportService2006::CatalogItem ^ CreateFolder(System::String ^ Folder, System::String ^ Parent);
public ReportService2006.CatalogItem CreateFolder (string Folder, string Parent);
member this.CreateFolder : string * string -> ReportService2006.CatalogItem
Public Function CreateFolder (Folder As String, Parent As String) As CatalogItem
Parametri
- Folder
- String
Nome della nuova cartella.
- Parent
- String
URL completo della cartella padre o del sito che conterrà la nuova cartella.
Restituisce
Oggetto CatalogItem per la cartella appena creata.
Esempio
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
class Sample
{
static void Main(string[] args)
{
ReportingService2006 rs = new ReportingService2006();
rs.Url = "http://<Server Name>" +
"/_vti_bin/ReportServer/ReportService2006.asmx";
rs.Credentials =
System.Net.CredentialCache.DefaultCredentials;
string folderName = "Budget";
string parent = "http://<Server Name>/Docs/Documents/";
try
{
rs.CreateFolder(folderName, parent);
Console.WriteLine("Folder created: {0}", folderName);
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml);
}
}
}
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2006()
rs.Url = "http://<Server Name>" + _
"/_vti_bin/ReportServer/ReportService2006.asmx"
rs.Credentials = _
System.Net.CredentialCache.DefaultCredentials
Dim folderName As String = "Budget"
Dim parentPath As String = _
"http://<Server Name>/Docs/Documents/"
Try
rs.CreateFolder(folderName, parentPath)
Console.WriteLine("Folder created: {0}", folderName)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml)
End Try
End Sub
End Class
Commenti
Nella tabella seguente vengono mostrate le informazioni sull'intestazione e sulle autorizzazioni relative a questa operazione.
Intestazioni SOAP | (In) TrustedUserHeaderValue (Out) ServerInfoHeaderValue |
Autorizzazioni necessarie | <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> |
La lunghezza del nome completo del percorso per la nuova cartella non può superare i 260 caratteri; in caso contrario, viene generata un'eccezione SOAP con il codice rsItemPathLengthExceeded
di errore .
I nomi delle cartelle devono essere inferiori a 128 caratteri. I nomi non possono essere Null, sono costituiti da stringhe vuote o contengono i caratteri riservati seguenti: : ? @ & = + $ , \ * >< | . ".
L'aggiunta di una cartella a una libreria di SharePoint modifica le ModifiedBy proprietà e ModifiedDate della cartella padre.