The following line
Environment.UserName
In debug mode in visual studio returns the identity of the user like I need.
Then when I se
Try something like this:
if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
{
string username = System.Web.HttpContext.Current.User.Identity.Name;
}
Important note: You need to configure IIS to enable integrated security and disable anonymous logon.
Note that Environment.Username
returns the Username on the current Thread.