次の方法で共有


AuthenticationManager.Unregister メソッド (String)

登録済みモジュールの一覧から指定した認証方式の認証モジュールを削除します。

Overloads Public Shared Sub Unregister( _
   ByVal authenticationScheme As String _)
[C#]
public static void Unregister(stringauthenticationScheme);
[C++]
public: static void Unregister(String* authenticationScheme);
[JScript]
public static function Unregister(
   authenticationScheme : String);

パラメータ

  • authenticationScheme
    削除するモジュールの認証方式。

例外

例外の種類 条件
ArgumentNullException authenticationScheme が null 参照 (Visual Basic では Nothing) です。
InvalidOperationException この認証方式のモジュールが登録されていません。

解説

Unregister メソッドは、 Authenticate メソッドによって呼び出される認証モジュールの一覧から、指定した認証方式の認証モジュールを削除します。一覧から削除する前に、 Register メソッドを使用して、そのモジュールが一覧に追加されている必要があります。

使用例

[Visual Basic, C#, C++] Unregister メソッドを使用して、登録されたモジュールのリストから指定した認証方式の認証モジュールを削除する例を次に示します。

 
Dim registeredModules As IEnumerator = AuthenticationManager.RegisteredModules
DisplayAllModules()

registeredModules.Reset()
registeredModules.MoveNext()

'Get the first Authentication module registered with the system
Dim authenticationModule1 As IAuthenticationModule = CType(registeredModules.Current, IAuthenticationModule)

'Call the UnRegister method to unregister the first authentication module from the system.
Dim authenticationScheme As [String] = authenticationModule1.AuthenticationType
AuthenticationManager.Unregister(authenticationScheme)
Console.WriteLine(ControlChars.Cr + "Successfully unregistered {0}", authenticationModule1)
'Display all modules to see that the module was unregistered.
DisplayAllModules()
'Call the Register method to register authenticationModule1 module again.
AuthenticationManager.Register(authenticationModule1)
Console.WriteLine(ControlChars.Cr + "Successfully re-registered {0}", authenticationModule1)
'Display the modules to verify that 'authenticationModule1' has been registered again.
DisplayAllModules()

[C#] 
IEnumerator registeredModules = AuthenticationManager.RegisteredModules; 
// Display all the modules that are already registered with the system.
DisplayAllModules();  
registeredModules.Reset();
registeredModules.MoveNext();
// Get the first Authentication module registered with the system.
IAuthenticationModule authenticationModule1 = (IAuthenticationModule)registeredModules.Current; 
// Call the UnRegister() method to unregister the first authentication module from the system.
String authenticationScheme = authenticationModule1.AuthenticationType;
AuthenticationManager.Unregister(authenticationScheme);
Console.WriteLine("\nSuccessfully unregistered '{0}",authenticationModule1+"'."); 
// Display all modules to see that the module was unregistered.
DisplayAllModules(); 

[C++] 
IEnumerator * registeredModules = AuthenticationManager::RegisteredModules; 
// Display all the modules that are already registered with the system.
DisplayAllModules();  
registeredModules->Reset();
registeredModules->MoveNext();
// Get the first Authentication module registered with the system.
IAuthenticationModule * authenticationModule1 = 
   dynamic_cast<IAuthenticationModule*>(registeredModules->Current);
// Call the UnRegister() method to unregister the first authentication module from the system.
String * authenticationScheme = authenticationModule1->AuthenticationType;
AuthenticationManager::Unregister(authenticationScheme);
Console::WriteLine("\nSuccessfully unregistered '{0}'.",authenticationModule1);
// Display all modules to see that the module was unregistered.
DisplayAllModules(); 

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

.NET Framework セキュリティ:

参照

AuthenticationManager クラス | AuthenticationManager メンバ | System.Net 名前空間 | AuthenticationManager.Unregister オーバーロードの一覧