语言

RoleManagerSection.CookieName 属性

定义

获取或设置用于缓存角色名称的 Cookie 的名称。

public:
 property System::String ^ CookieName { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))]
[System.Configuration.ConfigurationProperty("cookieName", DefaultValue=".ASPXROLES")]
[System.Configuration.StringValidator(MinLength=1)]
public string CookieName { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))>]
[<System.Configuration.ConfigurationProperty("cookieName", DefaultValue=".ASPXROLES")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.CookieName : string with get, set
Public Property CookieName As String

属性值

用于缓存角色名称的 Cookie 的名称。 默认值为“。ASPXROLES”。

属性

示例

下面的代码示例演示如何使用该 CookieName 属性。 该代码示例是 RoleManagerSection 类中的一个较大示例的一部分。

// Display CookieName property.
Console.WriteLine("CookieName: {0}", configSection.CookieName);
' Display CookieName property.
Console.WriteLine("CookieName: {0}", configSection.CookieName)

注解

该 CookieName 属性返回用于缓存角色名称的 Cookie 的名称。 可以通过为 ASP.NET 应用程序设置 cookieName Web.config 文件中的属性来指定为应用程序缓存角色的 Cookie 的名称。 如果要唯一标识应用程序的 Cookie 或跨多个应用程序共享 Cookie,这非常有用。

适用于