다음을 통해 공유


AuthenticationManager.RegisteredModules 속성

정의

인증 관리자로 등록하는 인증 모듈의 목록을 가져옵니다.

public:
 static property System::Collections::IEnumerator ^ RegisteredModules { System::Collections::IEnumerator ^ get(); };
public static System.Collections.IEnumerator RegisteredModules { get; }
static member RegisteredModules : System.Collections.IEnumerator
Public Shared ReadOnly Property RegisteredModules As IEnumerator

속성 값

등록된 인증 모듈을 읽을 수 있도록 하는 IEnumerator입니다.

예제

다음 예제에서는 사용 합니다 RegisteredModules 속성을 인증 관리자에 등록 된 인증 모듈의 목록을 가져옵니다. 전체 예제는 클래스를 참조하세요 AuthenticationManager .

// Display registered authentication modules.
static void displayRegisteredModules()
{
   
   // The AuthenticationManager calls all authentication modules sequentially
   // until one of them responds with an authorization instance.  Show
   // the current registered modules, for testing purposes.
   IEnumerator^ registeredModules = AuthenticationManager::RegisteredModules;
   Console::WriteLine( "\r\nThe following authentication modules are now registered with the system" );
   while ( registeredModules->MoveNext() )
   {
      Console::WriteLine( "\r \n Module : {0}", registeredModules->Current );
      IAuthenticationModule^ currentAuthenticationModule = dynamic_cast<IAuthenticationModule^>(registeredModules->Current);
      Console::WriteLine( "\t  CanPreAuthenticate : {0}", currentAuthenticationModule->CanPreAuthenticate );
   }
}
// Display registered authentication modules.
private static void DisplayRegisteredModules()
{
  // The AuthenticationManager calls all authentication modules sequentially
  // until one of them responds with an authorization instance.  Show
  // the current registered modules.
  IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
  Console.WriteLine("\r\nThe following authentication modules are now registered with the system:");
  while(registeredModules.MoveNext())
  {
    Console.WriteLine("\r \n Module : {0}",registeredModules.Current);
    IAuthenticationModule currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current;
    Console.WriteLine("\t  CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate);
  }
}
' Display registered authentication modules.
Private Shared Sub displayRegisteredModules()
  ' The AuthenticationManager calls all authentication modules sequentially 
  ' until one of them responds with an authorization instance.  Show
  ' the current registered modules.
  Dim registeredModules As IEnumerator = AuthenticationManager.RegisteredModules
  Console.WriteLine(ControlChars.Cr + ControlChars.Lf + "The following authentication modules are now registered with the system:")
  While registeredModules.MoveNext()
    Console.WriteLine(ControlChars.Cr + " " + ControlChars.Lf + " Module : {0}", registeredModules.Current)
    Dim currentAuthenticationModule As IAuthenticationModule = CType(registeredModules.Current, IAuthenticationModule)
    Console.WriteLine(ControlChars.Tab + "  CanPreAuthenticate : {0}", currentAuthenticationModule.CanPreAuthenticate)
  End While
End Sub

설명

속성은 RegisteredModules 등록된 인증 모듈 목록을 읽을 수 있는 인스턴스를 제공합니다 IEnumerator . 메서드는 Register 목록에 모듈을 추가하고 메서드는 Unregister 모듈을 제거합니다.

적용 대상