如何在IIS上传后显示客户端计算机名称? [英] How to display client computer name after upload in IIS ?

查看:59
本文介绍了如何在IIS上传后显示客户端计算机名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时使用此代码'

System.Net.Dns.GetHostEntry(Request.ServerVariables["REMOTE_ADDR"]).HostName



在本地电脑上工作正常当我在iis中运行并运行然后我收到此错误没有主机姓名退出?请帮助确切的代码



谢谢你



我尝试过:




in local pc its work fine bt when i host in iis and run then i got this error "NO host name exits? please help for exact code

Thank u

What I have tried:

System.Net.Dns.GetHostEntry(Request.ServerVariables["REMOTE_ADDR"]).HostName

推荐答案

你除非你在同一个网络上并且可以使用名称解析工具,否则无法获取计算机名称。在互联网上,客户端不会告诉网站它的名称是什么,所以网站无法知道。
You can't get the computer name unless you're on the same network and can use name resolution tools. Over the internet the client doesn't tell the website what its name is so there is no way for the website to know.


Request.UserHostAddress
or
Request.UserHostName


这篇关于如何在IIS上传后显示客户端计算机名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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