How to get current logged in Windows username?



Hi John,

If you use Windows authentication and deny anonymous
access, you can use HttpContext.Current.User.Identity.Name
to get domain log on user name.

HTH

Elton Wang
elton_wang@xxxxxxxxxxx


>-----Original Message-----
>
>
>I want to automate the process of logging into an
intranet. I want to pull
>out the username of the Windows user logged into the
machine running the
>browser and use the username in my app. How can I get the
logged in
>username?
>
>Do I have to disable the anonymous access in IIS? I
rather not because the
>site is running under a certain domain user which has
access to certain
>folder and network shares and the site needs thsi access
for reading and
>writing files.
>
>--
>John Dalberg
>.
>
.