AnonymousIdentificationModule.Enabled 屬性

定義

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

public:
 static property bool Enabled { bool get(); };
public static bool Enabled { get; }
static member Enabled : bool
Public Shared ReadOnly Property Enabled As Boolean

屬性值

如果已針對 ASP.NET 應用程式啟用匿名識別,則為 true,否則為 false。 預設為 false

範例

下列程式碼範例顯示啟用匿名識別之應用程式的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>  

適用於