Export (0) Print
Expand All

AuthenticationManager.RegisteredModules Property

Gets a list of authentication modules that are registered with the authentication manager.

Namespace: System.Net
Assembly: System (in system.dll)

public static IEnumerator RegisteredModules { get; }
/** @property */
public static IEnumerator get_RegisteredModules ()

public static function get RegisteredModules () : IEnumerator

Not applicable.

Property Value

An IEnumerator that enables the registered authentication modules to be read.

The RegisteredModules property provides an IEnumerator instance that enables the list of registered authentication modules to be read. The Register method adds modules to the list, and the Unregister method removes modules from it.

The following example uses the RegisteredModules property to get a list of authentication modules that are registered with the authentication manager. For a complete example, refer to the AuthenticationManager class.

// 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 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.get_RegisteredModules();
    Console.WriteLine("\r\nThe following authentication modules are now"
        + " registered with the system:");
    while (registeredModules.MoveNext()) {
        Console.WriteLine("\r \n Module : {0}", 
            registeredModules.get_Current());
        IAuthenticationModule currentAuthenticationModule = 
            ((IAuthenticationModule)(registeredModules.get_Current()));
        Console.WriteLine("\t  CanPreAuthenticate : {0}", 
            System.Convert.ToString(
            currentAuthenticationModule.get_CanPreAuthenticate()));
    }
} //DisplayRegisteredModules


Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft