getting LOGON USER in C#

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Feb 16, 2005.

  1. To get the logon user i use in VB.NET and it works:=
    <%= User.Identity.Name %>
    But when i use the same in C# it doesn't work why?
    Am i doing something wrong!!!!!!!!!!


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 16, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige

    Elton Wang Guest

    Do you deny anonymous access? If not User.Identity doen't
    work.

    Elton Wang

    >-----Original Message-----
    >To get the logon user i use in VB.NET and it works:=
    ><%= User.Identity.Name %>
    >But when i use the same in C# it doesn't work why?
    >Am i doing something wrong!!!!!!!!!!
    >
    >
    >*** Sent via Developersdex http://www.developersdex.com

    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    Elton Wang, Feb 17, 2005
    #2
    1. Advertising

  3. Yes i denied that.
    So User.Identity.Name doesn't work in C# but in VB it does..
    I used request.ServerVariables[LOGON_USER]; and it works for both C# and
    VB.NET.
    Patrick


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 17, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Dopierala Jr.

    Re: How to get Windows logon user credential?

    Ken Dopierala Jr., Aug 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,405
    cindy liu
    Aug 28, 2003
  2. venkat

    Retrieve logon user name from ADSI

    venkat, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    451
    venkat
    Nov 6, 2003
  3. Pradeep Kumar C
    Replies:
    3
    Views:
    603
    Steven Cheng[MSFT]
    May 25, 2004
  4. =?Utf-8?B?RXZhbiBCYXNhbGlr?=

    Getting windows logon when using forms authentication

    =?Utf-8?B?RXZhbiBCYXNhbGlr?=, May 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    561
    =?Utf-8?B?RXZhbiBULiBCYXNhbGlr?=
    May 12, 2005
  5. Kjell Kristiansson
    Replies:
    0
    Views:
    282
    Kjell Kristiansson
    Nov 30, 2005
Loading...

Share This Page