Home All Groups Group Topic Archive Search About
Author
30 Jan 2006 4:31 PM
Jim in Arizona
I'm more used to making webforms using ASPNET than I am doing windows
forms programming.

I was trying to figure out how I could get the current users logon name
so that I can manipulate code based on who they are. I tried this:

    Dim username As System.Net.NetworkCredential
         Label1.Text = username.UserName

That didn't help me out much.

In a web form, I would do something like this:

    strUsername = httpcontext.current.user.identity.name

That would return the current user's active directory username in the
form of domain\username.


TIA,
Jim

Author
30 Jan 2006 4:45 PM
Patrice
System.Environment provides a UserName and UserDomainName properties...

--
Patrice

Show quoteHide quote
"Jim in Arizona" <tiltow***@hotmail.com> a écrit dans le message de
news:Or3ctpbJGHA.3352@TK2MSFTNGP12.phx.gbl...
> I'm more used to making webforms using ASPNET than I am doing windows
> forms programming.
>
> I was trying to figure out how I could get the current users logon name
> so that I can manipulate code based on who they are. I tried this:
>
> Dim username As System.Net.NetworkCredential
>          Label1.Text = username.UserName
>
> That didn't help me out much.
>
> In a web form, I would do something like this:
>
> strUsername = httpcontext.current.user.identity.name
>
> That would return the current user's active directory username in the
> form of domain\username.
>
>
> TIA,
> Jim
Author
30 Jan 2006 4:59 PM
Jim in Arizona
Patrice wrote:
> System.Environment provides a UserName and UserDomainName properties...
>

Perfect! Thanks Patrice.

Dim username As System.Environment
Label1.Text = username.UserName

Jim