AnonymousIdentificationModule 類別

定義

為 ASP.NET 應用程式管理匿名識別項。

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
繼承
AnonymousIdentificationModule
實作

範例

下列程式碼範例顯示可啟用匿名識別之應用程式的Web.config檔案。

<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>  

備註

類別 AnonymousIdentificationModule 會建立和管理 ASP.NET 應用程式的匿名識別碼。 匿名識別碼是由支援匿名識別的功能使用,例如 ASP.NET System.Web.Profile

AnonymousIdentificationModuleCreating 公開事件,讓您將匿名識別碼設定為自訂值。 如果您未指定自訂匿名識別碼值, Guid 則會使用 。

在 ASP.NET 應用程式的 Global.asax 檔案中指定名為AnonymousIdentification_Creating的副程式,即可 Creating 存取此事件。

AnonymousIdentificationModule只有在匿名識別是 EnabledanonymousIdentification組態專案的 enabled 屬性設定為 true 時,才會使用 。

注意

匿名識別與任何類型的 ASP.NET 驗證無關。

建構函式

AnonymousIdentificationModule()

建立 AnonymousIdentificationModule 類別的執行個體。

屬性

Enabled

取得值,表示是否已針對 ASP.NET 應用程式啟用匿名識別。

方法

ClearAnonymousIdentifier()

清除與工作階段 (Session) 相關聯的匿名 Cookie 或識別項。

Dispose()

除了記憶體之外,釋放 AnonymousIdentificationModule 使用的所有資源。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
Init(HttpApplication)

初始化 AnonymousIdentificationModule 物件。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

事件

Creating

建立新的匿名識別項時發生。

適用於