且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在asp.net中获取客户端计算机名称

更新时间:2021-09-14 22:43:46

返回基础知识 - 在ASP.NET中获取客户端计算机名称 [ ^ ]


您可以使用以下代码片段查看是否有帮助



You can use following piece of code and see if it helps

string[] hostEntries = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });

txtECN.Text = hostEntries [0].ToString();





但是,不确定如果用户在防火墙/代理后面它会如何表现。



希望有帮助

Milind



However, not sure how it will behave in case the user is "behind" firewall/proxy.

Hope that helps
Milind