Partager via


Folder - Classe

Represents a folder on a SharePoint Web site.

Hiérarchie d’héritage

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.Folder

Espace de noms :  Microsoft.SharePoint.Client
Assemblys :   Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)

Syntaxe

'Déclaration
Public Class Folder _
    Inherits ClientObject
'Utilisation
Dim instance As Folder
public class Folder : ClientObject

Remarques

The UniqueContentTypeOrder property is not included in the default scalar property set for this type.

Exemples

This code example lists the folders on the current website.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class FolderExample
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            FolderCollection collFolder = site.Folders;
            clientContext.Load(collFolder);
            clientContext.ExecuteQuery();

            Console.WriteLine("The current site contains the following folders:\n\n");
            foreach (Folder myFolder in collFolder)
               Console.WriteLine(myFolder.Name);
        }
    }
}

Cohérence de thread

Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.

Voir aussi

Référence

Folder - Membres

Microsoft.SharePoint.Client - Espace de noms