June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want part of your code to execute under a different user account than that of the current user.
Log in to the new account with the unmanaged LogonUser function, and use the WindowsIdentity.Impersonate method.
By default, your code executes under the Windows identity of the current user. That means that your code has the ability to perform any action the user can and it will be prevented if it attempts any action that’s forbidden to the user. In some cases, however, you might want to allow your code to execute with different permissions than the current user account. For example, you might create an application that runs permanently on a shared kiosk in an organization. Before ...
Read now
Unlock full access