How to find Current User Name

H

Herb

When I run my ASP.NET application from my development PC,
Me.User.Identity.Name works. When I run it from my Intranet site, it does
not. Any suggestions?
 
H

Herb

No luck. This yields a blank string.
These are my three lines of code:
Response.Write(">" & Me.User.Identity.Name & "<<BR>")
Response.Write(">" & System.Security.Principal.WindowsIdentity.
GetCurrent().Name & "<<BR>")
Response.Write(">" & Context.User.Identity.Name & "<")

When run locally yields:
DOMAIN\USERNAME<
DOMAIN\USERNAME<
DOMAIN\USERNAME<

When run on the Intranet yields:
<
WEBSERVERNAME\ASPNET<
<


From
 
D

Dominick Baier

Then i guess you have'nt disabled anonymous auth on your intranet server
(in IIS)...
 
H

Herb

oops! it's always the simple things, isn't it? Incidentally,
Me.User.Identity.Name also works. Is there a preferred method?
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top