The SPDocumentLibrary class represents a document library in Microsoft Windows SharePoint Services.
The following table shows the public methods of the SPDocumentLibrary class and a brief description of each.
|GetItemsInFolder||Returns a collection of items from the document library based on the specified view and folder.|
The following table shows the public properties of the SPDocumentLibrary class, the data type of each property, and a brief description of each.
|DocumentTemplateUrl||String||Gets or sets the URL of the document template for the library.|
|EmailInsertsFolder||String||Gets or sets the path for the public folder that contains the e-mail items inserted in the document library.|
|IsCatalog||Boolean||Gets or sets a Boolean value that specifies whether the document library is a site template gallery or list template gallery.|
|Items||Microsoft.SharePoint.SPListItemCollection||Returns all the files within the document library, including those in any subfolders.|
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.
To obtain an SPDocumentLibrary object, cast the given list as a document library, such as follows:
[Visual Basic .NET] Dim documentLibrary As SPDocumentLibrary = CType(list, SPDocumentLibrary) [C#] SPDocumentLibrary documentLibrary = (SPDocumentLibrary)list;
The following code example iterates through all the sites and their lists and, excluding catalogs or form libraries, displays the name of the site and list, as well as the file name, for each item in every document library.
The example assumes the existence of a .aspx page that contains a label control.
Platforms: Microsoft Windows Server 2003
Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)
Security: Code Access Security