Exportar (0) Imprimir
Expandir Tudo
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original

Membership.ApplicationName Propriedade

Obtém ou define o nome do aplicativo.

Namespace:  System.Web.Security
Assembly:  System.Web (em System.Web. dll)

public static string ApplicationName { get; set; }

Valor da propriedade

Tipo: System.String

O nome do aplicativo.

The ApplicationName is used to identify users specific to an application.That is, the same user name can exist in the database for multiple ASP.NET applications that specify a different ApplicationName.Isso permite que Múltiplo os aplicativos usem o mesmo banco de dados para armazenar informações usuário sem execução em Duplicar conflitos de Nome de usuário.Alternatively, multiple ASP.NET applications can use the same user database by specifying the same ApplicationName.The ApplicationName can be set programmatically or declaratively in the configuration for the Web application.

Cuidado:

Because a single default membership provider instance is used for all of the requests served by an HttpApplication object, you can have multiple requests executing concurrently and attempting to set the ApplicationName property value.The ApplicationName property is not thread safe for multiple writes, and changing the ApplicationName property value can result in unexpected behavior for multiple users of an application.We recommend that you avoid writing code that allows users to set the ApplicationName property, unless you must.An example of an application where setting the ApplicationName property may be required is an administrative application that manages membership data for multiple applications.Tal um aplicativo deve ser um aplicativo de usuário único e não um aplicativo da Web.

The following code example shows the Elemento membership (Esquema de configurações do ASP.NET) element in the system.web section of the Web.config file for an ASP.NET application.It specifies that the application use a SqlMembershipProvider instance and sets the ApplicationName to MyApplication.

<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
  <providers>
    <add name="SqlProvider"
      type="System.Web.Security.SqlMembershipProvider"
      connectionStringName="SqlServices"
      enablePasswordRetrieval="true"
      enablePasswordReset="false"
      requiresQuestionAndAnswer="true"
      passwordFormat="Encrypted"
      applicationName="MyApplication" />
  </providers>
</membership>

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft