Partager via


RoleManagerSection.CookiePath Propriété

Définition

Obtient ou définit le chemin d'accès virtuel du cookie qui est utilisé pour mettre en cache des noms de rôles.

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

Valeur de propriété

String

Chemin d'accès du cookie utilisé pour stocker des noms de rôles. La valeur par défaut est "/".

Attributs

Exemples

L’exemple de code suivant montre comment utiliser la CookiePath propriété. Cet exemple de code fait partie d’un exemple plus grand fourni pour la RoleManagerSection classe.

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

Remarques

Vous pouvez spécifier le chemin d’accès du cookie dans lequel les noms de rôles sont mis en cache pour votre application en définissant l’attribut cookiePath dans le fichier Web.config de votre application ASP.NET. La CookiePath propriété retourne la valeur de l’attribut cookiePath à partir du fichier Web.config. Le chemin respecte la casse.

S’applique à