共用方式為


SPListItem.Properties property

取得中繼資料的項目。

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

Syntax

'宣告
Public ReadOnly Property Properties As Hashtable
    Get
'用途
Dim instance As SPListItem
Dim value As Hashtable

value = instance.Properties
public Hashtable Properties { get; }

Property value

Type: System.Collections.Hashtable
項目的中繼資料。

Examples

下面範例會從網站中的共享文件庫中取得第一個項目、 存取Properties屬性,並逐一查看雜湊表,列印每個主要和對應的值主控台的主控台應用程式。

Imports System
Imports System.Collections
Imports Microsoft.SharePoint

Module ConsoleApp
   Sub Main()
      Using site As SPSite = New SPSite("https://localhost")
         Using web As SPWeb = site.OpenWeb()

            Dim list As SPList = web.GetList("/shared documents/")
            If list.ItemCount > 0 Then
               Dim item As SPListItem = list.Items(0)
               Dim ht As Hashtable = item.Properties
               Dim de As DictionaryEntry
               For Each de In ht
                  Console.WriteLine("Key: {0}  Value: {1}", de.Key, de.Value)
               Next
            End If

         End Using
      End Using

      Console.ReadLine()
   End Sub
End Module
using System;
using Microsoft.SharePoint;
using System.Collections;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite site = new SPSite("https://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);
               }
            }
         }
         Console.ReadLine();
      }
   }
}

請參閱

參照

SPListItem class

SPListItem members

Microsoft.SharePoint namespace