I totally second the other answers, but I would like to highlight one more method which says
String UserName = Request.LogonUserIdentity.Name;
The above method returned me the username in the format: DomainName\UserName. For example, EUROPE\UserName
Which is different from:
String UserName = Environment.UserName;
Which displayed in the format: UserName
And finally:
String UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
which gave: NT AUTHORITY\IUSR
(while running the application on IIS server) and DomainName\UserName
(while running the application on a local server).