Username on client computer

  • Thread starter Thread starter EMW
  • Start date Start date
E

EMW

Hi,

For tracing and other thing I need to know the username of the user who is
logged in to the pc on which (s)he is running my ASPX page.

I was using:
System.Security.Principal.WindowsIdentity.GetCurrent.Name()
But that provides me with: SERVERNAME\ASPNET

I was hoping for the windows login name of the user.

Is there another way to get this?

rg,
Eric
 
For example, are you using
<authentication mode="Forms" >
or
<authentication mode="Windows" >
 
assuming that you're not using ASP.NET forms authentication mode,
(if you do, you can get username from session)
try using this code:

Dim userName() As String = Split(HttpContext.Current.User.Identity.Name,"\")
userName(0) '// contains Machine name or Domain name
userName(1) '// contains Username
 
thanks!

M. Zeeshan Mustafa said:
assuming that you're not using ASP.NET forms authentication mode,
(if you do, you can get username from session)
try using this code:

Dim userName() As String = Split(HttpContext.Current.User.Identity.Name,"\")
userName(0) '// contains Machine name or Domain name
userName(1) '// contains Username
 
Back
Top