Username on client computer

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
 
R

Rick Spiewak

For example, are you using
<authentication mode="Forms" >
or
<authentication mode="Windows" >
 
M

M. Zeeshan Mustafa

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
 
E

EMW

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top