Aracılığıyla paylaş


WindowsImpersonationContext.Undo Yöntem

Tanım

Kullanıcı bağlamını bu nesne tarafından temsil edilen Windows kullanıcıya geri çevirir.

public:
 void Undo();
public void Undo ();
member this.Undo : unit -> unit
Public Sub Undo ()

Özel durumlar

Bu yöntemi, kimliği kendine döndürmek dışında herhangi bir amaç için kullanmaya çalışılır.

Örnekler

Aşağıdaki örnekte, belirtilen kullanıcı belirtecini kullanarak bir Windows kimliğinin kimliğine bürünme adımları gösterilmektedir.

WindowsImpersonationContext^ ImpersonationCtx = WindowsIdentity::Impersonate( userToken );

//Do something under the context of the impersonated user.

ImpersonationCtx->Undo();
WindowsImpersonationContext ImpersonationCtx = WindowsIdentity.Impersonate(userToken);
//Do something under the context of the impersonated user.
 ImpersonationCtx.Undo();
Dim ImpersonationCtx As WindowsImpersonationContext = _
   WindowsIdentity.Impersonate(userToken)
'Do something under the context of the impersonated user. 
ImpersonationCtx.Undo()

Şunlara uygulanır