Re: how do you get current username in aspx?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 08:34:09 -0600

On Sat, 29 Jan 2005 13:34:35 -0500, "Flip" <!REMOVE_ME!phenry_w@hotmail.com> wrote:

¤ Howdy. I tried the following lines and to my astonishment, nothing is
¤ printed in the Trace for the username. What is happening here?
¤
¤ Trace.Write("username='" + HttpContext.Current.User.Identity.Name.ToString()
¤ +"'");
¤
¤ Trace.Write("usertostring=" + HttpContext.Current.User.ToString());
¤
¤ Trace.Write("type=" + HttpContext.Current.User.GetType().FullName);
¤
¤
¤
¤ THis gives this in the trace output.
¤
¤ username='' 0.003853 0.003408
¤ usertostring=System.Security.Principal.WindowsPrincipal 0.004247
¤ 0.000394
¤ type=System.Security.Principal.WindowsPrincipal
¤
¤

That doesn't look like valid syntax to me. Are you trying to retrieve the first and last name of the
user?

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)



Relevant Pages

  • Re: how do you get current username in aspx?
    ... Howdy. ... I tried the following lines and to my astonishment, ... printed in the Trace for the username. ...
    (microsoft.public.dotnet.framework)
  • Re: Help:How do you trace in this application?
    ... web interface, from database end, I only see one user name, if I ... select username from v$session, I got several app_user, with different ... sid, from the same machine, which is the application server machine, ... In the worst case you simply have to trace all sessions of this user, make your "special" user execute the commands you are interested in and switch off tracing for all again. ...
    (comp.databases.oracle.server)
  • Re: How to connect to a custom database
    ... When connecting as a Windows user, you most certainly *ARE* using a username and password, specifically your Windows username and password - that's what "integrated security" means... ... The error you're getting indicates that the user which is trying to connect to the instance of SSE doesn't have a valid SSE login. ... If you were using a full version of SQL Server, I'd have suggested that you simply set up a trace to see exactly what's happening. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: WSE 2.0 - The security token could not be authenticated or authorized
    ... When Usernametoken uses local user account, ... A Easy way troubleshoot this is to see the trace whether your created ... username Token has correct XML after enabling Trace option in config. ... > Authentication fails. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Sony MCH-S960 schematic
    ... howdy, does anyone have a print or any guidance on a unit that is DOA. ... I do have 12 V out of the PS and can trace to the Toshiba amp chip. ...
    (sci.electronics.repair)