SPListItem.Properties-Eigenschaft
Ruft die Metadaten für das Element ab.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public ReadOnly Property Properties As Hashtable
Get
'Usage
Dim instance As SPListItem
Dim value As Hashtable
value = instance.Properties
public Hashtable Properties { get; }
Eigenschaftswert
Typ: System.Collections.Hashtable
Die Metadaten für das Element.
Beispiele
Das folgende Beispiel ist eine Konsolenanwendung, die Ruft das ersten Elements aus der Bibliothek Freigegebene Dokumente in einer Website, greift auf die Properties -Eigenschaft und durchlaufen und die Hashtabelle drucken jeden Schlüssel und den entsprechenden Wert in der Konsole angezeigt.
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();
}
}
}