• <legend id='tlaee'><style id='tlaee'><dir id='tlaee'><q id='tlaee'></q></dir></style></legend>
    1. <tfoot id='tlaee'></tfoot>

      <small id='tlaee'></small><noframes id='tlaee'>

    2. <i id='tlaee'><tr id='tlaee'><dt id='tlaee'><q id='tlaee'><span id='tlaee'><b id='tlaee'><form id='tlaee'><ins id='tlaee'></ins><ul id='tlaee'></ul><sub id='tlaee'></sub></form><legend id='tlaee'></legend><bdo id='tlaee'><pre id='tlaee'><center id='tlaee'></center></pre></bdo></b><th id='tlaee'></th></span></q></dt></tr></i><div id='tlaee'><tfoot id='tlaee'></tfoot><dl id='tlaee'><fieldset id='tlaee'></fieldset></dl></div>
        <bdo id='tlaee'></bdo><ul id='tlaee'></ul>

      1. 使用 ActiveX 获取用户名

        时间:2023-10-13

                <tbody id='QNZpE'></tbody>

              <small id='QNZpE'></small><noframes id='QNZpE'>

              <tfoot id='QNZpE'></tfoot>

                • <bdo id='QNZpE'></bdo><ul id='QNZpE'></ul>

                • <legend id='QNZpE'><style id='QNZpE'><dir id='QNZpE'><q id='QNZpE'></q></dir></style></legend>

                • <i id='QNZpE'><tr id='QNZpE'><dt id='QNZpE'><q id='QNZpE'><span id='QNZpE'><b id='QNZpE'><form id='QNZpE'><ins id='QNZpE'></ins><ul id='QNZpE'></ul><sub id='QNZpE'></sub></form><legend id='QNZpE'></legend><bdo id='QNZpE'><pre id='QNZpE'><center id='QNZpE'></center></pre></bdo></b><th id='QNZpE'></th></span></q></dt></tr></i><div id='QNZpE'><tfoot id='QNZpE'></tfoot><dl id='QNZpE'><fieldset id='QNZpE'></fieldset></dl></div>
                  本文介绍了使用 ActiveX 获取用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在处理一个用经典 ASP 编写的旧 Intranet 站点.我正在尝试检索他们登录机器时使用的用户名.每个用户都登录到 AD,但我无法从服务器检索它,因为 Intranet 站点不使用 AD.

                  I'm working with an old intranet site written in classic ASP. I'm trying to retrieve their username they logged into their machine with. Each user is logged into AD, but I can't retrieve it from the server since the intranet site does not use AD.

                  有人告诉我可以使用 ActiveX 来检索它.我做了一些研究,发现了以下代码(javascript):

                  I was told I could use ActiveX in order to retrieve it. I did some research and I found the following code (javascript):

                  var wshshell = new ActiveXObject("WScript.shell");
                  var username = wshshell.ExpandEnvironmentalStrings("%username%");
                  

                  目前我使用的是 IE8,第一行出现自动化服务器无法创建对象"错误.

                  Currently I'm using IE8 and I get an "Automation server can't create object" error on that first line.

                  1) 任何想法为什么我会收到错误?

                  1) Any ideas why I'm getting the error?

                  2) 鉴于我的局限性,有没有更好的方法来做到这一点?

                  2) Is there a better way to be doing this given my limitations?

                  推荐答案

                  如果这是在客户端完成的,那么您必须让用户将站点添加到受信任的站点区域并将安全级别设置为最低.第 1 行应该在服务器端工作,但我认为第 2 行不正确.

                  If this is done client-side, then you must have the user add the site to the Trusted Sites zone and set the security level to the lowest. Line 1 should work server-side, but I don't think line 2 is right.

                  试试这个

                  var net = new ActiveXObject ( "WScript.NetWork" );
                  var username = net.UserName;
                  

                  这篇关于使用 ActiveX 获取用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:多个元素上的一个 jQuery 更改事件 下一篇:正则表达式匹配最后一个空格字符

                  相关文章

                  最新文章

                • <legend id='3cfBA'><style id='3cfBA'><dir id='3cfBA'><q id='3cfBA'></q></dir></style></legend>

                    • <bdo id='3cfBA'></bdo><ul id='3cfBA'></ul>
                    <tfoot id='3cfBA'></tfoot>

                      <i id='3cfBA'><tr id='3cfBA'><dt id='3cfBA'><q id='3cfBA'><span id='3cfBA'><b id='3cfBA'><form id='3cfBA'><ins id='3cfBA'></ins><ul id='3cfBA'></ul><sub id='3cfBA'></sub></form><legend id='3cfBA'></legend><bdo id='3cfBA'><pre id='3cfBA'><center id='3cfBA'></center></pre></bdo></b><th id='3cfBA'></th></span></q></dt></tr></i><div id='3cfBA'><tfoot id='3cfBA'></tfoot><dl id='3cfBA'><fieldset id='3cfBA'></fieldset></dl></div>

                      <small id='3cfBA'></small><noframes id='3cfBA'>