AnonymousIdentificationEventArgs 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供 AnonymousIdentification_Creating 事件的数据。 此类不能被继承。
public ref class AnonymousIdentificationEventArgs sealed : EventArgs
	public sealed class AnonymousIdentificationEventArgs : EventArgs
	type AnonymousIdentificationEventArgs = class
    inherit EventArgs
	Public NotInheritable Class AnonymousIdentificationEventArgs
Inherits EventArgs
		- 继承
 
示例
下面的代码示例使用 AnonymousIdentification_Creating 事件将匿名标识符设置为自定义值。
public void AnonymousIdentification_Creating(object sender, 
                                             AnonymousIdentificationEventArgs args)
{
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId();
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousID);
}
Public Sub AnonymousIdentification_Creating(sender As Object,  _
                                            args As AnonymousIdentificationEventArgs)
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId()
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousId)
End Sub
	注解
类 AnonymousIdentificationEventArgs 用于向事件提供事件值 Creating ,并使你能够为当前请求指定自定义 Windows 标识。 可以通过在 Creating Global.asax 文件中为 ASP.NET 应用程序指定名为 AnonymousIdentification_Creating 的子例程来访问 类的事件AnonymousIdentificationModule。
使用AnonymousIdentificationModule当前 HttpContext 构造AnonymousIdentificationEventArgs对象,并将其传递给 AnonymousIdentification_Creating 事件。
可以使用AnonymousID提供给 AnonymousIdentification_Creating 事件的 对象的 属性AnonymousIdentificationEventArgs将匿名标识符设置为自定义值。 如果在 AnonymousIdentification_Creating 事件期间未为 AnonymousID 属性指定值,Guid则使用 。
仅当匿名标识为 Enabled时,才会引发 AnonymousIdentification_Creating 事件。
构造函数
| AnonymousIdentificationEventArgs(HttpContext) | 
		 初始化 AnonymousIdentificationEventArgs 类的新实例。  | 
        	
属性
| AnonymousID | 
		 获取或设置用户的匿名标识符。  | 
        	
| Context | 
		 为当前 HTTP 请求获取 HttpContext 对象。  | 
        	
方法
| Equals(Object) | 
		 确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回表示当前对象的字符串。 (继承自 Object) |