SPWeb.Properties-Eigenschaft

Ruft ein SPPropertyBag -Objekt mit den Metadaten für die Website ab.

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

Syntax

'Declaration
Public ReadOnly Property Properties As SPPropertyBag
    Get
'Usage
Dim instance As SPWeb
Dim value As SPPropertyBag

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

Eigenschaftswert

Typ: Microsoft.SharePoint.Utilities.SPPropertyBag
Ein SPPropertyBag -Objekt, das Eigenschafteneinstellungen enthält.

Hinweise

Diese Eigenschaft gibt nur eine Teilmenge der Metadaten für eine Website. Wenn Sie alle Metadaten erhalten möchten, verwenden Sie die AllProperties -Eigenschaft.

Beispiele

Im folgende Beispiel wird eine Konsolenanwendung, die greift auf die Properties -Eigenschaft, durchlaufen, und druckt jeden Schlüssel/Wert-Paar in der Konsole angezeigt.

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

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("https://localhost"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPPropertyBag props = web.Properties;
                    foreach (DictionaryEntry de in props)
                    {
                        Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
                    }
                }
            }
            Console.ReadLine();
        }
    }
}
Imports System
Imports System.Collections
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Utilities

Namespace Test
    Friend Class Program
        Shared Sub Main(ByVal args() As String)
            Using site As New SPSite("https://localhost")
                Using web As SPWeb = site.OpenWeb()
                    Dim props As SPPropertyBag = web.Properties
                    For Each de As DictionaryEntry In props
                        Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value)
                    Next de
                End Using
            End Using
            Console.ReadLine()
        End Sub
    End Class
End Namespace

Die Ausgabe, die wird diese Anwendung in der Konsole gedruckt hängt von der Website, aber es kann wie folgt aussehen:

Key = vti_associatemembergroup, Value = 5
Key = vti_extenderversion, Value = 14.0.0.4016
Key = vti_associatevisitorgroup, Value = 4
Key = vti_associategroups, Value = 5;4;3
Key = vti_createdassociategroups, Value = 3;4;5
Key = vti_siteusagetotalbandwidth, Value = 547
Key = vti_siteusagetotalvisits, Value = 9
Key = vti_associateownergroup, Value = 3
Key = vti_defaultlanguage, Value = en-us

Siehe auch

Referenz

SPWeb Klasse

SPWeb-Member

Microsoft.SharePoint-Namespace