WindowsImpersonationContext.Undo Method ()


Reverts the user context to the Windows user represented by this object.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

Public Sub Undo

Exception Condition

An attempt is made to use this method for any purpose other than to revert identity to self.

Notes to Implementers:

Because Microsoft Windows 98 and Windows Millennium Edition platforms do not have users or user tokens, impersonation cannot take place on those platforms.

The following example shows how to impersonate a Windows identity using a specified user token.

Dim ImpersonationCtx As WindowsImpersonationContext = _
'Do something under the context of the impersonated user. 

.NET Framework
Available since 1.1
Return to top