单点登陆中根据用户名和密码实现自动登陆技巧

 <script type = "text/javascript">
    var sUsername="yinzhiling";
    var sPassword="123";
    if((sUsername!=null)&&(sUsername!=""))
    {
        var xmlHttp=new ActiveXObject("MSXML2.XMLHTTP");
        xmlHttp.open("GET","http://hzyinzl1/sites/ekp",false,sUsername,sPassword);
        xmlHttp.SetRequestHeader("Accept-Language","zh-cn");
        xmlHttp.send();
        if(xmlHttp.status=="200")
        {
            window.location .href ="http://hzyinzl1/sites/ekp";
         }
     }
  </script>

posted on 2006-11-16 15:00  尹智玲  阅读(266)  评论(0)    收藏  举报

导航