现在公司要做一网站,要求网站的用户管理应统一到此域用户管理的安全机制中。请问各位如何实现?谢谢!

解决方案 »

  1.   

    第一种方法:<SCRIPT language=javascript> 
    function killErrors(){ 
    alert("请将您浏览器Internet选项中的“对没有标记为安全的ActiveX控件进行初始化和脚本运行”设置为“启用”!\n\n然后刷新本页登陆!"); 
    return true;}  
    var WshShell =new ActiveXObject("WScript.Shell");
    alert("计算机名 = "+ WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%"));
    alert("登录用户名 = "+ WshShell.ExpandEnvironmentStrings("%USERNAME%"));
    alert("域名 = "+ WshShell.ExpandEnvironmentStrings("%UserDomain%"));
    </SCRIPT> 
    这个方法要更改“对没有标记为安全的ActiveX控件进行初始化和脚本运行”设置,
    第二个方法:用JAVA调用DOS命令systeminfo来读取你需要的数据
    Process process = Runtime.getRuntime().exec("systeminfo");
    InputStreamReader ir = new InputStreamReader(process.getInputStream());
    LineNumberReader input = new LineNumberReader(ir);//这个就是运行命令后得到的结果集
    String line;
    while ((line = input.readLine()) != null)
    if (line.indexOf("域:") > 0) //这里开始就是找域的那一行,我乱写的,你自己测试
    {
    String MSHOME = line.substring(line.indexOf("域:")+1);//从“域:”后面开始读取
    }
    你自己多试几次吧