MembershipProvider.ApplicationName 属性

定义

使用自定义成员资格提供程序的应用程序的名称。The name of the application using the custom membership provider.

public:
 abstract property System::String ^ ApplicationName { System::String ^ get(); void set(System::String ^ value); };
public abstract string ApplicationName { get; set; }
member this.ApplicationName : string with get, set
Public MustOverride Property ApplicationName As String

属性值

使用自定义成员资格提供程序的应用程序的名称。The name of the application using the custom membership provider.

示例

有关MembershipProvider实现的示例,请参阅实现配置文件提供程序For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

注解

ApplicationName属性值存储在数据源中,其中包含相关的用户信息,以将用户与特定应用程序相关联。The ApplicationName property value is stored in the data source with related user information to associate a user with a particular application. 此属性是可读/写的ApplicationPath ,如果未显式指定,则默认为属性值。This property is read/write and defaults to the ApplicationPath property value if not specified explicitly.

由于成员资格提供程序为每个应用程序单独存储用户信息,因此,如果创建了重复的用户名,则多个 ASP.NET 应用程序可以使用相同的数据源,而不会发生冲突。Because membership providers store user information uniquely for each application, multiple ASP.NET applications can use the same data source without running into a conflict if duplicate user names are created. 另外,多个 ASP.NET 应用程序可以通过指定相同ApplicationName的用户数据源来使用相同的用户数据源。Alternatively, multiple ASP.NET applications can use the same user data source by specifying the same ApplicationName.

在成员资格提供程序实现中,你将需要确保你的数据架构包含ApplicationName ,并且数据源查询和更新还ApplicationName包括。In your membership provider implementation, you will need to ensure that your data schema includes the ApplicationName and that data source queries and updates also include the ApplicationName.

适用于

另请参阅