Langue

ReportingService2006.CreateFolder(String, String) Méthode

Définition

Ajoute un dossier à une bibliothèque bibliothèque 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

Paramètres

Folder
String

Le nom du nouveau dossier.

Parent
String

L’URL entièrement qualifiée pour le dossier parent ou le site qui contiendra le nouveau dossier.

Retours

Un CatalogItem objet pour le dossier nouvellement créé.

Exemples

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  

Remarques

Le tableau ci-dessous présente les informations sur l’en-tête et les autorisations concernant cette opération.

En-têtes SOAP (En) TrustedUserHeaderValue

(Dehors) ServerInfoHeaderValue
Autorisations requises <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>

La longueur complète du nom du chemin du nouveau dossier ne peut pas dépasser 260 caractères ; sinon, une exception SOAP est lancée avec le code rsItemPathLengthExceededd’erreur .

Les noms de dossiers doivent faire moins de 128 caractères. Les noms ne peuvent pas être nuls, constitués de chaînes vides, ni contenir les caractères réservés suivants : ? @ & = + $ , \ * >< | . ".

Ajouter un dossier à une bibliothèque bibliothèque SharePoint modifie les ModifiedBy propriétés et ModifiedDate du dossier parent.

S’applique à