Below are revisions for this snippet.

Another Impersonator Class





Syndication

Revision Revison 1
With this simple class you can run som code with others user accounts.
How to use:

// ...some code
using(Impersonator user = new Impersonator("domain", "user", "pswd"))
{
// This run with new credentials.
}
// ... more code