SPGlobalConfig.Properties property
NOTE: This API is now obsolete.
已過時。取得可用的通用組態設定SharePoint Foundation部署中。
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<ObsoleteAttribute("Most of the functionality in this class is available in SPFarm or SPWebService.", _
False)> _
Public ReadOnly Property Properties As SPPropertyBag
Get
'用途
Dim instance As SPGlobalConfig
Dim value As SPPropertyBag
value = instance.Properties
[ObsoleteAttribute("Most of the functionality in this class is available in SPFarm or SPWebService.",
false)]
public SPPropertyBag Properties { get; }
Property value
Type: Microsoft.SharePoint.Utilities.SPPropertyBag
SPPropertyBag 物件包含通用組態設定。
Examples
下列程式碼範例會重覆Properties屬性所傳回的金鑰與值配對的集合,並顯示每對。
這個範例需要Microsoft.SharePoint.Administration和Microsoft.SharePoint.Utilities命名空間using指示詞 (在 Visual Basic 中的Imports )。
[Visual Basic]
Dim globAdmin As New SPGlobalAdmin()
Dim globConfig As SPGlobalConfig = globAdmin.Config
Dim propBag As SPPropertyBag = globConfig.Properties
Dim keys As System.Collections.ICollection = propBag.Keys
Dim key As Object
For Each key In keys
Response.Write(SPEncode.HtmlEncode(key.ToString()) + " :: " + SPEncode.HtmlEncode(propBag(key.ToString())) + "<BR>")
Next key
[C#]
SPGlobalAdmin globAdmin = new SPGlobalAdmin();
SPGlobalConfig globConfig = globAdmin.Config;
SPPropertyBag propBag = globConfig.Properties;
System.Collections.ICollection keys = propBag.Keys;
foreach (object key in keys)
{
Response.Write(SPEncode.HtmlEncode(key.ToString()) + " :: " + SPEncode.HtmlEncode(propBag[key.ToString()]) + "<BR>");
}