RoleProvider.ApplicationName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定應用程式名稱以儲存及檢索角色資訊。
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
屬性值
應用程式名稱,用於儲存和檢索角色資訊。
範例
以下程式碼範例展示了該 ApplicationName 屬性的範例實作。
private string pApplicationName;
public override string ApplicationName
{
get { return pApplicationName; }
set { pApplicationName = value; }
}
Private pApplicationName As String
Public Overrides Property ApplicationName As String
Get
Return pApplicationName
End Get
Set
pApplicationName = value
End Set
End Property
備註
類別用Roles來ApplicationName將使用者和角色與不同應用程式關聯起來。 這使得多個應用程式能使用同一個資料庫來儲存使用者與角色資訊,而不會發生重複使用者名稱或角色名稱之間的衝突。 多個 ASP.NET 應用程式可以透過在屬性中指定相同的值 ApplicationName 來使用同一個資料庫。 此 ApplicationName 屬性可透過程式設定,或在網頁應用程式的設定檔中使用 applicationName 屬性以宣告式設定。
若未 ApplicationName 指定房產,建議使用房產 ApplicationVirtualPath 價值。