Using ActiveX to get username

后端 未结 2 1659
闹比i
闹比i 2020-12-21 09:46

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

2条回答
  •  离开以前
    2020-12-21 10:35

    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.

    Try this

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

提交回复
热议问题