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

屬性值

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>

適用於