次の方法で共有


AuthenticationManager.Unregister メソッド

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

オーバーロードの一覧

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

.NET Compact Framework でもサポート。

[Visual Basic] Overloads Public Shared Sub Unregister(IAuthenticationModule)

[C#] public static void Unregister(IAuthenticationModule);

[C++] public: static void Unregister(IAuthenticationModule*);

[JScript] public static function Unregister(IAuthenticationModule);

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

.NET Compact Framework でもサポート。

[Visual Basic] Overloads Public Shared Sub Unregister(String)

[C#] public static void Unregister(string);

[C++] public: static void Unregister(String*);

[JScript] public static function Unregister(String);

使用例

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

[Visual Basic, C#, C++] メモ   ここでは、Unregister のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。

 
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++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

参照

AuthenticationManager クラス | AuthenticationManager メンバ | System.Net 名前空間