471,570 Members | 902 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

Running code using another user context

Good Evening,

I Would like to know if is it possible to execute some code with another
user's context, of course, typing its username and password. I lnow its
possible in Visual Basic 6, but I would like to know how its possible in C#
or VB.net

Thanks a lot,

André.

--
André.
Dec 22 '05 #1
1 2485
Andre,

Check out the documentation on the static Impersonate method on the
WindowsIdentity class. It will have an example of how to logon using
another's credentials, and then run code under that user context.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maximus-br" <Ma*******@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
Good Evening,

I Would like to know if is it possible to execute some code with another
user's context, of course, typing its username and password. I lnow its
possible in Visual Basic 6, but I would like to know how its possible in
C#
or VB.net

Thanks a lot,

André.

--
André.

Dec 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Anil Kumar Sharma | last post: by
1 post views Thread by daniel_xi | last post: by
6 posts views Thread by =?Utf-8?B?cHJhZGVlcF9UUA==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.