共用方式為


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 方法會從清單中移除模組。

適用於