Share via


SPWeb.Properties property

Obtém um objeto SPPropertyBag com os metadados do site.

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

Syntax

'Declaração
Public ReadOnly Property Properties As SPPropertyBag
    Get
'Uso
Dim instance As SPWeb
Dim value As SPPropertyBag

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

Property value

Type: Microsoft.SharePoint.Utilities.SPPropertyBag
Um objeto SPPropertyBag que contém as configurações de propriedades.

Comentários

Essa propriedade retorna somente um subconjunto dos metadados de um site. Para obter todos os metadados, use a propriedade AllProperties .

Examples

O exemplo a seguir é um aplicativo de console que acessa a propriedade Properties , itera através da coleção e imprime cada par chave/valor no console.

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

A saída deste aplicativo imprime no console varia de acordo com o site, mas ele pode parecer com o seguinte:

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

Ver também

Referência

SPWeb class

SPWeb members

Microsoft.SharePoint namespace