如何访问通过Request.UserHostName连接到我的网站的用户的计算机名称? [英] How can I access to computer name of a user who connect to my web site by Request.UserHostName?

查看:92
本文介绍了如何访问通过Request.UserHostName连接到我的网站的用户的计算机名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何访问通过Request.UserHostName连接到我的网站的用户的计算机名称?

我发现此代码可访问连接到我的网站的用户的计算机名称
ClientName = Request.UserHostName;
但是,当我将此代码放入按钮时,我会保存我的计算机的名称而不是用户计算机的名称.
如何使用此代码?
请求在哪里发送UserHostName?


非常感谢

How can I access to computer name of a user who connect to my web site by Request.UserHostName?
Hi
I find this code for access to computer name of a user who connect to my web site
ClientName = Request.UserHostName;
But when I put this code in a button, I will sav name of my computer no name of user computer.
How can I use of this code?
Where the Request send UserHostName?


Thanks very much

推荐答案

如果您是Intranet,Request.UserHostName将可以正常工作.但是,如果您在Internet站点上工作,则以下代码将非常有用:

If you are intranet, Request.UserHostName will work perfectly. But, if you are working on internet sites, the below code will be useful:

System.Net.Dns.GetHostEntry(userHost).HostName


这篇关于如何访问通过Request.UserHostName连接到我的网站的用户的计算机名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆