Reputation: 1057
I'm trying to get my logged username of my client, but I get still server-information. This are my trys:
Environment.UserName;
System.Security.Principal.WindowsIdentity.GetCurrent().User;
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
System.Net.Dns.GetHostName();
Request.ServerVariables["REMOTE_ADDR"];
Request.UserHostAddress;
Upvotes: 0
Views: 3634
Reputation: 191
Typically I use User.Identity.Name, which returns the login name the user accessing the application enters.
e.g.var loginName = User.Identity.Name;
Upvotes: 1