Export (0) Print
Expand All

SPListItem.Properties property

Gets metadata for the item.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public Hashtable Properties { get; }

Property value

Type: System.Collections.Hashtable
The metadata for the item.

The following example is a console application that gets the first item from the Shared Documents library in a Web site, accesses the Properties property, and iterates through the hash table, printing each key and corresponding value to the console.

using System;
using Microsoft.SharePoint;
using System.Collections;

namespace Test
   class ConsoleApp
      static void Main(string[] args)
         using (SPSite site = new SPSite("http://localhost"))
            using (SPWeb web = site.OpenWeb())
               SPList list = web.GetList("/shared documents/");
               if (list.ItemCount > 0)
                  SPListItem item = list.Items[0];
                  Hashtable ht = item.Properties;
                  foreach (DictionaryEntry de in ht)
                     Console.WriteLine("Key: {0}  Value: {1}", de.Key, de.Value);
© 2014 Microsoft