SPWeb.AllProperties property
取得包含網站的中繼資料的雜湊資料表。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public ReadOnly Property AllProperties As Hashtable
Get
'用途
Dim instance As SPWeb
Dim value As Hashtable
value = instance.AllProperties
public Hashtable AllProperties { get; }
Property value
Type: System.Collections.Hashtable
包含中繼資料的雜湊資料表。
備註
將大型 amonts 的資料儲存在這個屬性將會降低效能。不要在此屬性中儲存以上一個千位元組 (1 k) 的使用者資料。
Examples
下列範例是一個主控台應用程式,存取網站的 [ AllProperties ] 屬性,逐一雜湊表中的項目,並列印到主控台的每個索引鍵/值組。
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
應用程式寫入主控台的輸出會隨著網站,但它看起來可能如下所示:
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
請參閱
參照
Microsoft.SharePoint namespace