AnonymousIdentificationModule.Enabled 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會獲得一個值,指示 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
屬性值
true 若啟用匿名識別,則為 ASP.NET 應用;否則為 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>