AuthenticationManager.Unregister 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
등록된 모듈 목록에서 인증 모듈을 제거합니다.
오버로드
| Name | Description |
|---|---|
| Unregister(IAuthenticationModule) |
등록된 모듈 목록에서 지정된 인증 모듈을 제거합니다. |
| Unregister(String) |
등록된 모듈 목록에서 지정된 인증 체계를 가진 인증 모듈을 제거합니다. |
Unregister(IAuthenticationModule)
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
등록된 모듈 목록에서 지정된 인증 모듈을 제거합니다.
public:
static void Unregister(System::Net::IAuthenticationModule ^ authenticationModule);
public static void Unregister(System.Net.IAuthenticationModule authenticationModule);
static member Unregister : System.Net.IAuthenticationModule -> unit
Public Shared Sub Unregister (authenticationModule As IAuthenticationModule)
매개 변수
- authenticationModule
- IAuthenticationModule
IAuthenticationModule 등록된 모듈 목록에서 제거할 항목입니다.
예외
authenticationModule은 null입니다.
지정한 IAuthenticationModule 값이 등록되지 않았습니다.
예제
다음 예제에서는 이 메서드를 사용하여 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.
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;
}
' 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
End Class
설명
이 메서드는 Unregister 메서드에서 호출하는 인증 모듈 목록에서 지정된 인증 모듈을 Authenticate 제거합니다. 모듈을 목록에서 제거하려면 먼저 메서드를 Register 사용하여 목록에 추가되어야 합니다.
적용 대상
Unregister(String)
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
- Source:
- AuthenticationManager.cs
등록된 모듈 목록에서 지정된 인증 체계를 가진 인증 모듈을 제거합니다.
public:
static void Unregister(System::String ^ authenticationScheme);
public static void Unregister(string authenticationScheme);
static member Unregister : string -> unit
Public Shared Sub Unregister (authenticationScheme As String)
매개 변수
- authenticationScheme
- String
제거할 모듈의 인증 체계입니다.
예외
authenticationScheme은 null입니다.
이 인증 체계에 대한 모듈이 등록되지 않았습니다.
예제
다음 예제에서는 메서드를 Unregister 사용 하 여 등록 된 모듈 목록에서 지정 된 인증 체계를 사용 하 여 인증 모듈을 제거 합니다.
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();
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()
설명
이 메서드는 Unregister 메서드에서 호출한 인증 모듈 목록에서 지정된 인증 체계를 사용하여 인증 모듈을 Authenticate 제거합니다. 모듈을 목록에서 제거하려면 먼저 메서드를 Register 사용하여 목록에 추가되어야 합니다.