FormsAuthenticationUserCollection クラス
アセンブリ: System.Web (system.web.dll 内)

Public NotInheritable Class FormsAuthenticationUserCollection Inherits ConfigurationElementCollection

FormsAuthenticationCredentials は FormsAuthenticationUserCollection を使用して、authorization 構成セクションの forms セクション内の credentials セクションの users 要素にプログラムからアクセスして変更できます。
この型は、FormsAuthenticationConfiguration 型、FormsAuthenticationCredentials 型、FormsAuthenticationUser 型を含むグループの一部です。

既存の Web アプリケーションの構成ファイルから FormsAuthenticationUserCollection オブジェクトを取得する方法を次のコード例に示します。
![]() |
---|
credentials 要素を使用する場合は、「ASP.NET の認証」に説明されているガイドラインに従う必要があります。スケーラビリティとセキュリティを高めるため、外部のデータベースを使用して、ユーザーの資格情報を保管することをお勧めします。安全な ASP.NET アプリケーションを構築する方法の詳細については、Microsoft MSDN Web サイト (msdn.microsoft.com) で、「Securing Your ASP.NET Application」や「Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication」を参照してください。 |
' Get the Web application configuration. Dim configuration As System.Configuration.Configuration = _ WebConfigurationManager.OpenWebConfiguration( _ "/aspnetTest") ' Get the authentication section. Dim authenticationSection _ As AuthenticationSection = _ CType(configuration.GetSection( _ "system.web/authentication"), AuthenticationSection) ' Get the forms credentials collection . Dim formsAuthenticationCredentials _ As FormsAuthenticationCredentials = _ authenticationSection.Forms.Credentials
// Get the Web application configuration. System.Configuration.Configuration configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest"); // Get the authentication section. AuthenticationSection authenticationSection = (AuthenticationSection)configuration.GetSection( "system.web/authentication"); // Get the forms credentials collection . FormsAuthenticationCredentials formsAuthenticationCredentials = authenticationSection.Forms.Credentials;

System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Web.Configuration.FormsAuthenticationUserCollection


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- FormsAuthenticationUserCollection クラスのページへのリンク