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 配置文件属性概述。 有关添加到 ASP.NET 版本 2.0 的配置文件功能的详细信息,请参阅 ASP.NET 配置文件属性概述。
构造函数
| 名称 | 说明 |
|---|---|
| ProfileGroupSettingsCollection() |
初始化 ProfileGroupSettingsCollection 类的新实例。 |
属性
方法
显式接口实现
| 名称 | 说明 |
|---|---|
| ICollection.CopyTo(Array, Int32) |
将 ConfigurationElementCollection 复制到数组。 (继承自 ConfigurationElementCollection) |
扩展方法
| 名称 | 说明 |
|---|---|
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |