Network Username

G

Geoff Murley

Is there a simple command I can use to retrieve the
username of the user currently logged onto a client PC,
viewing my ASP.NET page?

I really want the ASP.NET equivalent of
SystemInformation.UserName
 
B

Brock Allen

HttpContext.Current.User.Identity.Name, or just User.Identity.Name in the
context of a page. This assumes you're using Windows authentication in your
ASP.NET app.
 
G

Geoff Murley

Hi, I am using Windows authentication , however, both of
your suggestions return an empty string. Is there
something else I should check?
 
G

Geoff Murley

I've got it to work now. I didn't turn off Allow
Anonymous access in IIS.

Thanks for your help.
 
B

Brock Allen

Check in IIS that you've disabled anonymous authentication for your application.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top