By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,464 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,464 IT Pros & Developers. It's quick & easy.

capture window username to imporsonate

P: n/a
How do I get the window username and password information so that I can imporsonate to access a remote file server using the UNC path using asp .net or c# code.
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jax
The userName can be got like this:

SystemInformation.UserName

Dont know about the password though.
Nov 15 '05 #2

P: n/a
He indicated that he was using ASP.NET. In this case,
SystemInformation.UserName might not work becuase ASP.NET is running in a
special account.

As for the password, imagine how insecure the system would be if any program
at any time could read both the username and password. Trojan horses would
have a field day. So, no, it is probably not possible to read the password.

ASP.NET makes it relatively easy to impersonate the logged in user. It has
been a while since I had to do this but you might try turning anonymous off
and setting the @impersonate attribute on the <identity> tag to "true" in
the machine.config. That way the ASP.NET process takes on the identity of
the person who is sitting at the browser.

"Jax" <an*******@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
The userName can be got like this:

SystemInformation.UserName

Dont know about the password though.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.