如何从Asp.net Web应用程序客户端计算机名称(互联网应用程序) [英] How to get Client computer name from Asp.net web application (internet application)

查看:184
本文介绍了如何从Asp.net Web应用程序客户端计算机名称(互联网应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在asp.net web应用程序来获得客户端计算机名称?

Is it possible to get Client Computer name in asp.net web application ?

我不希望使用ActiveX对象,因为它是不是在所有浏览器都支持。

I don't want to use ActiveX object as it is not supported in all browsers.

我建立在Azure中托管,因此它不使用波纹管code给予适当的计算机名称会一个应用程序。

I am building a Application which is going to hosted in Azure so it is not giving proper Computer name using bellow code.

字符串pCName =
  System.Net.Dns.GetHostEntry(this.Page.Request.UserHostAddress).HostName

string pCName= System.Net.Dns.GetHostEntry(this.Page.Request.UserHostAddress).HostName

这code仅适用于Intranet应用程序。任何一个可以建议我的解决方案或替代解决方案让客户端PC名称?

This code works only with intranet application. can any one suggest me solution or any alternative solution to get Client PC Name ?

推荐答案

您可以用codeS计算机名称,如果他们是在网络中(内部网)如你所说,工作正常。

You can get Computer names using codes if they are in a network(intranet) which works fine as you suggested.

在当系统通过互联网访问有没有计算机的名称,而在同一时间的 名称

At the same time when the system is accessed via internet there is no computer name rather Domain name.

我想请求正在做客户端的机器名
  从。随着ASP我能得到的IP地址。但我不知道怎么弄
  机器的名称。有什么我可以从客户端做
  一面?

I want to get the machine name of the client the request is being made from. With ASP I can get the IP address. But I don’t know how to get the name of the machine. Is there something I could do from the client side?

<一个href=\"http://blogs.msdn.com/b/ericlippert/archive/2005/05/09/how-to-obtain-the-name-of-the-client-from-the-asp-server.aspx\"相对=nofollow>无 ,Web浏览器客户端无法确定机器的名称。

No, the web browser client cannot determine the name of the machine.

客户端和服务器不应该相互信任。在缺少...之下
  认证的证据,客户必须承担所有服务器都在运行
  邪恶的黑客和服务器必须假设所有的客户端是由运行
  邪恶的黑客的攻击。一旦你接受了基本的设计原则,那么
  它变得理性有关客户端 - 服务器的交互更加容易。
  认为像一个邪恶的人!

Clients and servers should not trust each other. In the absence of authentication evidence, clients must assume that all servers are run by evil hackers and servers must assume that all clients are run by evil hackers. Once you accept that fundamental design principle then it becomes much easier to reason about client-server interactions. Think like an evil person!

在主题的更多引用(检索系统名称),你可以参考:

More reference on the topic (Retrieving the system name) , you can refer :

堆栈溢出的帖子:


  1. Get客户端IP地址和系统名称

  2. How与jQuery或JavaScript或服务器端codeS获取客户端(用户)机器名(计算机名)。

希望,将投入更多的光线上的问题。

Hope that will put more light on the issue.

这篇关于如何从Asp.net Web应用程序客户端计算机名称(互联网应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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