Dear,
Actually I am using Windows XP - SP2 . My friends who are working on the same project using the same settings with same OS does not have any problem by disabling Anonymous user from their IIS settings. The problem is that when I change my IIS settings exactly same with my friends' settings I got the login/authorisation problem but my friends does not get. This made me suspect that there is some problem in my OS settings related to web application (IIS, ASP.Net and related applications).
We do not wanted to use form authentication or something else, what we want is to disable "Anonymous" user, enable "Integrated Windows Authentication" and able to open the page without any prompt for Username and Password. Below is our piece of code which will retrieve username
1 public static string GetCurrentUsername()
2 {
3 string user = System.Security.Principal.WindowsIdentity.GetCurrent().Name;//It does not assign value to variable user
4 //string user = HttpContext.Current.Request.ServerVariables["LOGON_USER"];//This does not work either
5 int domainIndex = user.IndexOf(@"\");
6 if (domainIndex != -1)
7 return user.Substring(domainIndex + 1);
8 return user;
9 }
I badly need help, what can i do, please friends help me.
Regards,