AnonymousIdentificationSection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为未验证身份的用户配置匿名标识。 此类不能被继承。
public ref class AnonymousIdentificationSection sealed : System::Configuration::ConfigurationSection
public sealed class AnonymousIdentificationSection : System.Configuration.ConfigurationSection
type AnonymousIdentificationSection = class
inherit ConfigurationSection
Public NotInheritable Class AnonymousIdentificationSection
Inherits ConfigurationSection
- 继承
示例
以下示例演示如何从基础配置文件获取 AnonymousIdentificationSection 对象。 使用此对象来获取或设置相关的配置值。
// Get the applicaqtion configuration.
Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the section.
AnonymousIdentificationSection anonymousIdentificationSection =
(AnonymousIdentificationSection)configuration.GetSection(
"system.web/anonymousIdentification");
' Get the applicaqtion configuration.
Dim configuration _
As Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim anonymousIdentificationSection _
As AnonymousIdentificationSection = _
CType(configuration.GetSection( _
"system.web/anonymousIdentification"), _
AnonymousIdentificationSection)
注解
类 AnonymousIdentificationSection 允许以编程方式访问和修改 anonymousIdentification
配置文件的 元素。
匿名标识的目的是在计算机和应用程序级别为未经身份验证的用户分配唯一标识。 然后,可以使用此唯一标识来跟踪用户。 此上下文中使用的匿名标识与 Web 请求颁发者的标识或与用户相关的其他安全方面没有任何关系;它只是分配一个唯一标识,用于跟踪和用户状态管理。
匿名用户通常使用 Session
标识符进行跟踪。 此方法的主要问题是标识符的非唯一 Session
性,以及存储数据以设置状态值所涉及的开销,为了向用户分配会话标识符,必须这样做。 匿名标识通过为每个未经身份验证的用户提供唯一标识符来解决这些问题,并且不需要用户存储任何数据来设置标识符。
构造函数
AnonymousIdentificationSection() |
初始化 AnonymousIdentificationSection 类的新实例。 |