单点登陆中根据用户名和密码实现自动登陆技巧
<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>
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>
浙公网安备 33010602011771号