如何从JavaScript中检索客户端计算机名称? [英] How to retrieve client machine name from javascript?

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

问题描述

我有一个ASP.NET应用程序,它位于服务器上,但可以从客户端计算机访问。我需要应用程序来检索访问该应用程序的客户端计算机的计算机名称。我怎么能用javascript做到这一点?



我的尝试:



尝试使用ActiveXObject但不起作用

I have an ASP.NET application that is located on the server but is accessed from client machines. I need the application to retrieve computer name of the client computer that accesses the application. How can I do that using javascript?

What I have tried:

Tried using ActiveXObject but doesn't work

推荐答案

你不能。出于安全原因,Javascript代码无法使用浏览器运行的实际机器的详细信息,其中包括机器名称。



您唯一的方法是ActiveX控件祝你好运 - 它们只能运行不到1%的现代机器(然后只运行极低安全性的机器)。
You can't. Details about the actual machine the browser is running on are not available to Javascript code for security reasons, and that includes the machine name.

Your only method is an ActiveX control, and good luck with that - they will only run on less than 1% of modern machines (and then only the very-low-security-settings ones).


这篇关于如何从JavaScript中检索客户端计算机名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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