Properties Property

SPFolder.Properties Property

Gets a hash table that contains metadata for the folder.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public Hashtable Properties { get; }

Property Value

Type: System.Collections.Hashtable
A System.Collections.Hashtable object that contains the metadata.

The following code example iterates through the collection of folders in the current Web site and displays the properties and values for each folder.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint and Microsoft.SharePoint.Utilities namespaces.

SPWeb oWebsite = SPContext.Current.Web;
SPFolderCollection collFolders = oWebsite.Folders;

foreach (SPFolder oFolder in collFolders)
{
   System.Collections.Hashtable oHashtable = oFolder.Properties;
   System.Collections.ICollection collKeys = oHashtable.Keys;

      foreach (object oKey in collKeys)
      {
         Response.Write(SPEncode.HtmlEncode(oKey.ToString()) + " :: " + 
             SPEncode.HtmlEncode(hashtable[oKey.ToString()]) + "<BR>");
      }
}

The previous example displays metadata such as the following:

vti_dirlateststamp :: 8/30/2006 1:06:19 AM
vti_etag :: "{101141FF-9E99-4404-AE4D-561B981472E4},0"
vti_isexecutable :: false
vti_candeleteversion :: true
vti_docstoretype :: 1
vti_timecreated :: 8/21/2006 1:28:31 AM
vti_isbrowsable :: true
vti_hassubdirs :: true
vti_listname :: {B6C3C6F9-A256-4FA4-B6A2-97549D48E530}
vti_replid :: rid:{101141FF-9E99-4404-AE4D-561B981472E4}
vti_listenableversioning :: false
vti_listenableminorversions :: false
vti_listbasetype :: 1
vti_level :: 1
vti_rtag :: rt:101141FF-9E99-4404-AE4D-561B981472E4@00000000000
vti_timelastmodified :: 8/21/2006 1:28:41 AM
vti_listservertemplate :: 101
vti_listrequirecheckout :: false
vti_listenablemoderation :: false
vti_listtitle :: TestDocLib2
vti_isscriptable :: false
Show:
© 2016 Microsoft