SPWeb.AllProperties 属性

Gets a hash table that contains metadata for the website.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public ReadOnly Property AllProperties As Hashtable
    Get
用法
Dim instance As SPWeb
Dim value As Hashtable

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

属性值

类型:System.Collections.Hashtable
A hash table that contains metadata.

备注

Storing large amonts of data in this property will degrade performance. Do not store more than one kilobyte (1k) of user data in this property.

示例

The following example is a console application that accesses the AllProperties property of a website, iterates through the entries in the hash table, and prints each key/value pair to the console.

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

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

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 ht As Hashtable = web.AllProperties
                    For Each de As DictionaryEntry In ht
                        Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value)
                    Next de
                End Using
            End Using
            Console.ReadLine()
        End Sub
    End Class
End Namespace

The output that the application writes to the console varies with the website, but it might look something like the following:

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_approvallevels, Value = Approved Rejected Pending\ Review
Key = vti_categories, Value = Travel Expense\ Report Business Competition Goals/Objectives Ideas Miscellaneous Waiting VIP In\ Process Planning Schedule
Key = vti_siteusagetotalbandwidth, Value = 547
Key = vti_siteusagetotalvisits, Value = 9
Key = vti_associateownergroup, Value = 3
Key = vti_defaultlanguage, Value = en-us

另请参阅

引用

SPWeb 类

SPWeb 成员

Microsoft.SharePoint 命名空间

其他资源

Metakeys