Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I using below mention code to get logged windows username,
IIdentity WinId = HttpContext.Current.User.Identity;
WindowsIdentity wi = (WindowsIdentity)WinId;
string user_name = wi.Name;


for this code,
1.I have unchecked anonymous authentication in IIS.
2.Enabled windows authentication.

But while running it's asking windows login prompt. then only i m getting logged windows username.

I need using anonymous authentication to get windows username. !!!!!!!

Please do needful...
Posted
Comments
$*Developer - Vaibhav*$ 4-Apr-14 7:28am    
set user authentication of internet browser

Tools->Internet Option->Security->custom lebel->user authentication ->Logon->

Set automatic login with current user id and password.

1 solution

If you want to get the windows user name of the client use is using your application, you have to either use windows authentication or ask the user to enter the user name somewhere in your application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900