AnonymousIdentificationModule Klass

Definition

Hanterar anonyma identifierare för ASP.NET-programmet.

public ref class AnonymousIdentificationModule sealed : System::Web::IHttpModule
public sealed class AnonymousIdentificationModule : System.Web.IHttpModule
type AnonymousIdentificationModule = class
    interface IHttpModule
Public NotInheritable Class AnonymousIdentificationModule
Implements IHttpModule
Arv
AnonymousIdentificationModule
Implementeringar

Exempel

I följande kodexempel visas en Web.config fil för ett program som möjliggör anonym identifiering.

<configuration>
  <system.web>
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
    </authentication>

    <anonymousIdentification enabled="true" />

    <profile defaultProvider="AspNetSqlProvider">
      <properties>
        <add name="ZipCode" allowAnonymous="true" />
        <add name="CityAndState" allowAnonymous="true" />
        <add name="StockSymbols" type="System.Collections.ArrayList"
          allowAnonymous="true" />
      </properties>
    </profile>
  </system.web>
</configuration>

Kommentarer

Klassen AnonymousIdentificationModule skapar och hanterar anonyma identifierare för ett ASP.NET program. Anonyma identifierare används av funktioner som stöder anonym identifiering, till exempel ASP.NET System.Web.Profile.

Exponerar AnonymousIdentificationModule en Creating händelse som gör att du kan ange ett anpassat värde för den anonyma identifieraren. Om du inte anger ett anpassat värde för anonym identifierare används en Guid .

Händelsen Creating nås genom att ange en underrutin med namnet AnonymousIdentification_Creating i filen Global.asax för ditt ASP.NET-program.

AnonymousIdentificationModule Används endast när anonym identifiering är Enabled genom att ange det aktiverade attributet för konfigurationselementet anonymousIdentification till true.

Note

Anonym identifiering är oberoende av alla typer av ASP.NET autentisering.

Konstruktorer

Name Description
AnonymousIdentificationModule()

Skapar en instans av AnonymousIdentificationModule klassen.

Egenskaper

Name Description
Enabled

Hämtar ett värde som anger om anonym identifiering är aktiverad för ASP.NET-programmet.

Metoder

Name Description
ClearAnonymousIdentifier()

Rensar den anonyma cookien eller identifieraren som är associerad med en session.

Dispose()

Släpper alla resurser, förutom minne, som används av AnonymousIdentificationModule.

Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
Init(HttpApplication)

Initierar AnonymousIdentificationModule-objektet.

MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Händelser

Name Description
Creating

Inträffar när en ny anonym identifierare skapas.

Gäller för