ProfileGroupSettingsCollection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包含一組 ProfileGroupSettings 物件。
public ref class ProfileGroupSettingsCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileGroupSettings), AddItemName="group")]
public sealed class ProfileGroupSettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileGroupSettings), AddItemName="group")>]
type ProfileGroupSettingsCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class ProfileGroupSettingsCollection
Inherits ConfigurationElementCollection
- 繼承
- 屬性
範例
以下設定檔摘錄展示了如何宣告式地指定設定檔中ProfileGroupSettingsCollection元素中若干屬性<group><properties><profile>的值。
<system.web>
<profile enabled = "true" defaultProvider="AspNetSqlProfileProvider">
<providers>
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider "
connectionStringName="LocalSqlServer"
applicationName="/"
description="Stores and retrieves profile data from the
local Microsoft SQL Server database" />
</providers>
<properties>
<group name = "SiteColors" >
<add name = "BackGround"/>
<add name = "SideBar"/>
<add name = "ForeGroundText"/>
<add name = "ForeGroundBorders"/>
</group>
<group name="Forums">
<add name = "HasAvatar" type="bool" provider="Forums"/>
<add name = "LastLogin" type="DateTime" provider="Forums"/>
<add name = "TotalPosts" type="int" provider="Forums"/>
</group>
</properties>
</profile>
</system.web>
備註
該 ProfileGroupSettingsCollection 類別包含一組 ProfileGroupSettings 物件,每個物件又包含一組 ProfilePropertySettings 物件。
此ProfilePropertySettings類別提供一種程式化方式,可以程式化地建立、存取及修改設定檔該區段子節<properties>中新增<profile>的個別屬性定義。
設定檔的 <profile> 部分指定了使用者設定檔的結構。 執行時,ASP.NET 編譯系統會利用該 <profile> 區段指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。
ProfileCommon類別定義基於設定檔該<properties>節子節中定義<profile>的屬性。
欲了解更多關於剖面屬性的資訊,請參閱 ASP.NET 剖面屬性概覽。 欲了解 2.0 版本新增 ASP.NET 設定檔功能,請參見 ASP.NET 設定檔屬性概覽。
建構函式
| 名稱 | Description |
|---|---|
| ProfileGroupSettingsCollection() |
初始化 ProfileGroupSettingsCollection 類別的新執行個體。 |
屬性
方法
明確介面實作
| 名稱 | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
將 ConfigurationElementCollection 複製到陣列。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| 名稱 | Description |
|---|---|
| AsParallel(IEnumerable) |
啟用查詢的平行處理。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別篩選 IEnumerable 的專案。 |