Share via


AnonymousIdentificationSection.Enabled 属性

定义

获取或设置一个指示是否启用匿名标识的值。

public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=false)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=false)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

属性值

如果启用匿名标识,则为 true;否则为 false。 默认值为 false

属性

示例

下面的代码示例演示如何访问 Enabled 属性。

   // Get Enabled.
   bool aIdEnabled =
       anonymousIdentificationSection.Enabled;

   Console.WriteLine("Anonymous identification enabled: {0}",
       aIdEnabled.ToString());
' Get Enabled.
Dim aIdEnabled As Boolean = _
anonymousIdentificationSection.Enabled
Console.WriteLine("Anonymous identification enabled: {0}", _
aIdEnabled.ToString())

注解

如果 Enabled 设置为 true,则使用 Cookie 来管理用户的状态信息。

适用于