草庐IT

clientMachineName

全部标签

c# - 如何在 ASP.NET/C# 中获取客户端机器名称?

我有应用程序想要获取用户机器名称,在这里我可以检索并且它在本地主机上工作正常。stringclientPCName;string[]computer_name=System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_host"]).HostName.Split(newChar[]{'.'});clientPCName=computer_name[0].ToString();在本地它返回我的计算机名称。但是在服务器上我得到这样的结果:0x57364794有什么解决办法吗? 最佳答案