使用Java脚本的计算机名称问题 [英] Computer Name Using Javascript Problem

查看:79
本文介绍了使用Java脚本的计算机名称问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我叫VIkash Gohil.
我有带有Javascript代码的ASP.net应用程序,如下所示,

Hello, I am VIkash Gohil.
I have ASP.net application with Javascript code as below,

var oWs = new ActiveXObject("WScript.Shell");



我们正在使用它来获取客户端计算机名称.

我已经在客户端的服务器上安装了此应用程序,这是一个Intranet应用程序.在装有XP Sp2和Windows2003 Server的PC上,代码无法正常运行.但是在装有Win XP Sp3的PC上显示"ActiveX组件无法创建对象".我已经检查了所有IE设置并启用了ActiveX控件运行的所有选项.我登录到计算机的用户也具有管理权限.谁能告诉我为什么会这样,还是可以在任何Windows操作系统下运行的此代码的替代方法.

在此先感谢,等待您的答复.



We are using this to get client Computer name.

I have installed this application on Client''s server and this is an intranet application. Not the Code runs fine on PC with XP Sp2 and Windows2003 Server. but on a PC with Win XP Sp3 it says, ActiveX Component Can''t Create Object. I have Checked all the IE Settings and enabled all options for ActiveX Controls to run. Also the user i am logging in to the computer has administrative rights. Can any one tell me why this is happening, or any alternative to this code which runs under any windows OS.

Thanks in Advance, Awaiting a reply soon.

推荐答案

关注此 [链接]

投票是否有帮助
follow this [link]

vote if it helps


我认为最好不要使用它.默认情况下,大多数计算机都将其禁用.

相反,您应该使用Header来获取所有信息,可以使用Server变量等.
I think it is better not to use this. Most of the computers disables it by default.

Rather you should use Header to get all info, may be use Server variables etc.


这篇关于使用Java脚本的计算机名称问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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