登録済みモジュールの一覧から指定した認証モジュールを削除します。
Overloads Public Shared Sub Unregister( _
ByVal authenticationModule As IAuthenticationModule _)
[C#]
public static void Unregister(IAuthenticationModuleauthenticationModule);
[C++]
public: static void Unregister(IAuthenticationModule* authenticationModule);
[JScript]
public static function Unregister(
authenticationModule : IAuthenticationModule);
パラメータ
- authenticationModule
登録されたモジュールのリストから削除する IAuthenticationModule 。
例外
| 例外の種類 | 条件 |
|---|---|
| ArgumentNullException | authenticationModule が null 参照 (Visual Basic では Nothing) です。 |
| InvalidOperationException | 指定した IAuthenticationModule は登録されていません。 |
解説
Unregister メソッドは、 Authenticate メソッドによって呼び出される認証モジュールの一覧から指定した認証モジュールを削除します。一覧から削除する前に、 Register メソッドを使用して、そのモジュールが一覧に追加されている必要があります。
使用例
[Visual Basic, C#, C++] Unregister メソッドを使用して、登録されたモジュールのリストから、指定した認証モジュールを削除する例を次に示します。詳細については、 AuthenticationManager クラスのトピックを参照してください。
' This is the program entry point. It allows the user to enter
' her credentials and the Internet resource (Web page) to access.
' It also unregisters the standard and registers the customized basic
' authentication.
Private Overloads Shared Sub Main(ByVal args() As String)
If args.Length < 4 Then
showusage()
Else
' Read the user's credentials.
uri = args(1)
username = args(2)
password = args(3)
If args.Length = 4 Then
domain = String.Empty
' If the domain exists, store it. Usually the domain name
' is by default the name of the server hosting the Internet
' resource.
Else
domain = args(5)
End If
' Unregister the standard Basic authentication module.
AuthenticationManager.Unregister("Basic")
' Instantiate the custom Basic authentication module.
Dim customBasicModule As New CustomBasic()
' Register the custom Basic authentication module.
AuthenticationManager.Register(customBasicModule)
' Display registered Authorization modules.
displayRegisteredModules()
' Read the specified page and display it on the console.
getPage(uri)
End If
Return
End Sub 'Main
[C#]
// This is the program entry point. It allows the user to enter
// her credentials and the Internet resource (Web page) to access.
// It also unregisters the standard and registers the customized basic
// authentication.
public static void Main(string[] args)
{
if (args.Length < 3)
showusage();
else
{
// Read the user's credentials.
uri = args[0];
username = args[1];
password = args[2];
if (args.Length == 3)
domain = string.Empty;
else
// If the domain exists, store it. Usually the domain name
// is by default the name of the server hosting the Internet
// resource.
domain = args[3];
// Unregister the standard Basic authentication module.
AuthenticationManager.Unregister("Basic");
// Instantiate the custom Basic authentication module.
CustomBasic customBasicModule = new CustomBasic();
// Register the custom Basic authentication module.
AuthenticationManager.Register(customBasicModule);
// Display registered Authorization modules.
displayRegisteredModules();
// Read the specified page and display it on the console.
getPage(uri);
}
return;
}
[C++]
// This is the program entry point. It allows the user to enter
// her credentials and the Internet resource (Web page) to access.
// It also unregisters the standard and registers the customized basic
// authentication.
public:
static void Main()
{
String* args[] = Environment::GetCommandLineArgs();
if (args->Length < 4)
showusage();
else
{
// Read the user's credentials.
uri = args[1];
username = args[2];
password = args[3];
if (args->Length == 4)
domain = String::Empty;
else
// If the domain exists, store it. Usually the domain name
// is by default the name of the server hosting the Internet
// resource.
domain = args[4];
// Unregister the standard Basic authentication module.
AuthenticationManager::Unregister(S"Basic");
// Instantiate the custom Basic authentication module.
CustomBasic* customBasicModule = new CustomBasic();
// Register the custom Basic authentication module.
AuthenticationManager::Register(customBasicModule);
// Display registered Authorization modules.
displayRegisteredModules();
// Read the specified page and display it on the console.
getPage(uri);
}
return;
}
[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 セキュリティ:
- SecurityPermission (アンマネージ コードを実行するために必要なアクセス許可) SecurityPermissionFlag (関連する列挙体)
参照
AuthenticationManager クラス | AuthenticationManager メンバ | System.Net 名前空間 | AuthenticationManager.Unregister オーバーロードの一覧