0

我正在尝试获取我的客户端登录用户名,但我仍然得到服务器信息。这是我的尝试:

Environment.UserName;
System.Security.Principal.WindowsIdentity.GetCurrent().User;
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
System.Net.Dns.GetHostName();
Request.ServerVariables["REMOTE_ADDR"];
Request.UserHostAddress;
4

1 回答 1

1

通常我使用 User.Identity.Name,它返回访问应用程序的用户输入的登录名。

例如var loginName = User.Identity.Name;

于 2013-03-21T15:46:12.143 回答