ProfilePropertySettings 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
ProfilePropertySettings 類別 (Class) 提供以程式的方法,存取和修改組態檔的 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
- 繼承
範例
下列程式碼範例示範如何存取 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 提供一種方式,以程式設計方式建立、存取和修改新增至 properties
組態檔區段子 profile
區段的個別屬性定義。
組態檔的 區 profile
段會指定使用者設定檔的架構。 在執行時間,ASP.NET 編譯系統會使用 區段中指定 profile
的資訊來產生名為 ProfileCommon
的類別,其衍生自 ProfileBase 。 類別 ProfileCommon
定義是以組態檔區段子區段中 profile
定義的 properties
屬性為基礎。 系統會為每個使用者設定檔建立此類別的實例,而且您可以透過 HttpContext.Profile 屬性存取程式碼中的個別設定檔值。 如需配置檔案屬性的詳細資訊,請參閱 配置檔案屬性概觀 ASP.NET。 如需新增至 ASP.NET 2.0 之設定檔功能的詳細資訊,請參閱 ASP.NET 配置檔案屬性概觀。
建構函式
ProfilePropertySettings(String) |
使用指定的名稱,初始化 ProfilePropertySettings 類別的新執行個體。 |
ProfilePropertySettings(String, Boolean, SerializationMode, String, String, String, Boolean, String) |
使用指定的名稱和設定,初始化 ProfilePropertySettings 類別的新執行個體。 |
屬性
方法
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應