Properties Property

The Properties property of the SPFile class gets metadata for the file.

Property Value

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

Remarks

The object model does not support updating file metadata.

Example

This example retrives the "date" property.

myDataRow["DateTime"] = Convert.ToDateTime(myfile.Properties["date"]).ToUniversalTime();

The following code example iterates through the collection of files in a document library and displays the properties and values for each file.

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

The previous example displays metadata like the following:

vti_author :: User_Name
vti_cachedtitle :: New Page 1
vti_metatags :: HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\ FrontPage\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\ charset=windows-1252
vti_progid :: FrontPage.Editor.Document
vti_cachedbodystyle ::
vti_modifiedby :: User_Name
vti_charset :: windows-1252
vti_sourcecontrolcheckincomment :: Comment
vti_nexttolasttimemodified :: 5/6/2003 8:16:58 PM
vti_filesize :: 6439
vti_docstoretype :: 0
vti_language :: en-us
vti_generator :: Microsoft FrontPage 5.0
vti_timelastmodified :: 5/6/2003 8:59:25 PM
vti_title :: File_Title
vti_docstoreversion :: 2
vti_sourcecontrolcookie :: fp_internal
vti_sourcecontrolversion :: V2
vti_cachedneedsrewrite :: false
vti_timecreated :: 5/6/2003 8:16:58 PM
vti_cachedcustomprops :: vti_title
vti_cachedhastheme :: false

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security