HostingEnvironment.Impersonate Method (IntPtr)
.NET Framework 2.0
Impersonates the user represented by the specified user token.
Namespace: System.Web.Hosting
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public static IDisposable Impersonate ( IntPtr token )
public static function Impersonate ( token : IntPtr ) : IDisposable
Not applicable.
Parameters
- token
The handle of a Windows account token.
Return Value
An IDisposable object that represents the Windows user prior to impersonation; this object can be used to revert to the original user's context.- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.
- SecurityPermission for impersonating. Demand value: Demand. Permission value: Unrestricted.