共用方式為


ProfilePropertySettings 類別

定義

這個 ProfilePropertySettings 類別提供一種程式化的方式,可以存取並修改設定檔的該 profiles 區段。 無法繼承這個類別。

public ref class ProfilePropertySettings sealed : System::Configuration::ConfigurationElement
public sealed class ProfilePropertySettings : System.Configuration.ConfigurationElement
type ProfilePropertySettings = class
    inherit ConfigurationElement
Public NotInheritable Class ProfilePropertySettings
Inherits ConfigurationElement
繼承
ProfilePropertySettings

範例

以下程式碼範例說明如何存取 PropertySettings 包含一組 ProfilePropertySettings 物件的屬性值。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。

// Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:");
int rootPPSCtr = 0;
foreach (ProfilePropertySettings rootPPS in profileSection.PropertySettings)
{
    Console.WriteLine("  {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr,
        rootPPS.Name);
}
' Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:")
Dim rootPPSCtr As Integer = 0
For Each rootPPS As ProfilePropertySettings In profileSection.PropertySettings
    Console.WriteLine("  {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr, _
        rootPPS.Name)
Next

備註

ProfilePropertySettings類別提供一種程式化方式,可以程式化地建立、存取及修改設定檔該區段子節profile中新增properties的個別屬性定義。

設定檔的 profile 部分指定了使用者設定檔的結構。 執行時,ASP.NET 編譯系統會利用該 profile 區段指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。 ProfileCommon類別定義基於設定檔該profile節子節中定義properties的屬性。 每個使用者設定檔都會建立一個這個類別的實例,你可以透過這個 HttpContext.Profile 屬性存取程式碼中的各個設定檔值。 欲了解更多關於剖面屬性的資訊,請參閱 ASP.NET 剖面屬性概覽。 欲了解更多關於 ASP.NET 2.0新增設定檔功能,請參見 ASP.NET 設定檔屬性總覽

建構函式

名稱 Description
ProfilePropertySettings(String, Boolean, SerializationMode, String, String, String, Boolean, String)

初始化一個以指定名稱和設定的新類別實例 ProfilePropertySettings

ProfilePropertySettings(String)

初始化一個以指定名稱的新 ProfilePropertySettings 類別實例。

屬性

名稱 Description
AllowAnonymous

會取得或設定一個值,表示動態產生 ProfileCommon 類別中相關屬性是否能由匿名使用者設定。

CurrentConfiguration

會取得代表該Configuration實例所屬配置階層的頂層ConfigurationElement實例參考。

(繼承來源 ConfigurationElement)
CustomProviderData

取得或設定一串自訂資料給設定檔屬性提供者。

DefaultValue

取得或設定動態產生 ProfileCommon 類別中相關屬性的預設值。

ElementInformation

取得 ElementInformation 一個包含不可自訂資訊與功能的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
ElementProperty

取得 ConfigurationElementProperty 代表該 ConfigurationElement 物件本身的物件。

(繼承來源 ConfigurationElement)
EvaluationContext

取得 ContextInformation 物件的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
HasContext

獲得一個表示該 CurrentConfiguration 性質是否為 null的值。

(繼承來源 ConfigurationElement)
Item[ConfigurationProperty]

取得或設定此組態元素的屬性或屬性。

(繼承來源 ConfigurationElement)
Item[String]

取得或設定該配置元素的屬性、屬性或子元素。

(繼承來源 ConfigurationElement)
LockAllAttributesExcept

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockAllElementsExcept

獲得鎖定元素的集合。

(繼承來源 ConfigurationElement)
LockAttributes

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockElements

獲得鎖定元素的集合。

(繼承來源 ConfigurationElement)
LockItem

取得或設定一個值,表示該元素是否被鎖定。

(繼承來源 ConfigurationElement)
Name

取得或設定動態產生ProfileCommon類別中物件名稱ProfilePropertySettings及相關屬性。

Properties

取得一組房產。

(繼承來源 ConfigurationElement)
Provider

在序列化已命名屬性時,取得或設定提供者名稱以供使用。

ReadOnly

取得或設定一個值,用以判斷動態產生 ProfileCommon 類別中相關屬性是否為唯讀。

SerializeAs

取得或設定動態產生 ProfileCommon 類別中相關屬性所用的序列化方法。

Type

取得或設定動態產生 ProfileCommon 類別中相關屬性的類型名稱。

方法

名稱 Description
DeserializeElement(XmlReader, Boolean)

從設定檔讀取 XML。

(繼承來源 ConfigurationElement)
Equals(Object)

將目前 ConfigurationElement 實例與指定的物件進行比較。

(繼承來源 ConfigurationElement)
GetHashCode()

會獲得代表當前 ConfigurationElement 實例的唯一值。

(繼承來源 ConfigurationElement)
GetTransformedAssemblyString(String)

回傳指定的組裝名稱轉換後版本。

(繼承來源 ConfigurationElement)
GetTransformedTypeString(String)

回傳指定型別名稱的轉換後版本。

(繼承來源 ConfigurationElement)
GetType()

取得目前實例的 Type

(繼承來源 Object)
Init()

將物件設定 ConfigurationElement 為初始狀態。

(繼承來源 ConfigurationElement)
InitializeDefault()

用於初始化物件的預設值 ConfigurationElement 集合。

(繼承來源 ConfigurationElement)
IsModified()

表示此組態元素自最後儲存或載入後是否被修改,且實作於衍生類別中。

(繼承來源 ConfigurationElement)
IsReadOnly()

會取得一個值,表示該物件是否 ConfigurationElement 為唯讀。

(繼承來源 ConfigurationElement)
ListErrors(IList)

將此 ConfigurationElement 物件及所有子元素中的無效屬性錯誤加入已傳遞的清單中。

(繼承來源 ConfigurationElement)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
OnDeserializeUnrecognizedAttribute(String, String)

獲得一個值,表示在反序列化過程中是否遇到未知屬性。

(繼承來源 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

會獲得一個值,表示在反序列化過程中是否遇到未知元素。

(繼承來源 ConfigurationElement)
OnRequiredPropertyNotFound(String)

當找不到所需的屬性時,會拋出例外。

(繼承來源 ConfigurationElement)
PostDeserialize()

在解序後被呼叫。

(繼承來源 ConfigurationElement)
PreSerialize(XmlWriter)

在序列號之前就被打過。

(繼承來源 ConfigurationElement)
Reset(ConfigurationElement)

重置物件的 ConfigurationElement 內部狀態,包括鎖與屬性集合。

(繼承來源 ConfigurationElement)
ResetModified()

在導出類別實作時,將方法的值IsModified()重置為 。false

(繼承來源 ConfigurationElement)
SerializeElement(XmlWriter, Boolean)

當在衍生類別中實作時,會將此組態元素的內容寫入設定檔。

(繼承來源 ConfigurationElement)
SerializeToXmlElement(XmlWriter, String)

當在衍生類別中實作時,會將此組態元素的外部標籤寫入設定檔。

(繼承來源 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

將屬性設定為指定的值。

(繼承來源 ConfigurationElement)
SetReadOnly()

設定 IsReadOnly() 物件及所有子元素的 ConfigurationElement 屬性。

(繼承來源 ConfigurationElement)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

修改物件 ConfigurationElement 以移除所有不應儲存的值。

(繼承來源 ConfigurationElement)

適用於

另請參閱