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