function ExchangeLogin() {
vstrServer='<%=LocationUrl %>'
vstrDomain = '<%=userLogin.AD %>'
vstrUsername = document.getElementById("<%=UserNameTxt.ClientID%>").value;
vstrPassword = document.getElementById("<%=PassWordTxt.ClientID%>").value;
if (vstrUsername == "" || vstrPassword == "")
{ alert("用户名密码不能为空!"); return; }
var strUrl = "https://" + vstrServer + "/owa/auth/owaauth.dll";
var strExchange = { destination: 'https://' + vstrServer + '/owa',
flags: '0', forcedownlevel: '0',
trusted: '0', isutf8: '1', username: vstrUsername, password: vstrPassword
}; var myForm = document.createElement("form");
myForm.method = "post";
myForm.action = strUrl; for (var varElement in strExchange) { var myInput = document.createElement("input");
myInput.setAttribute("name", varElement);
myInput.setAttribute("value", strExchange[varElement]);
myForm.appendChild(myInput);
} document.body.appendChild(myForm);
myForm.submit();
document.body.removeChild(myForm);
}