您现在的位置: 破洛洛 >> 建站学院 >> 网站开发 >> Oracle教程 >> 正文

如何编写远程登陆MOSS的代码

作者:佚名 来源:CNZZ 更新时间:2010-4-13
分享到

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <html  >

  <head>

  <title></title>

  <script language="javascript"  type="text/javascript">

  var objXmlHttp = null;

  function DoSend(url)

  {

  var strUser = document.getElementById("username").value;

  var strPwd = document.getElementById("password").value;

  setTimeout("dodo('"+url+"','"+strUser+"','"+strPwd+"')",80);

  }

  function dodo(url, struser, strpwd)

  {

  var objXmlHttp = new ActiveXObject('MICROSOFT.XMLHTTP');

  try

  {

  objXmlHttp.open("GET", "" + url, false, struser, strpwd);

  objXmlHttp.send();

  if (objXmlHttp.status =="200" && objXmlHttp.readyState ==4) {

  window.location.href = "http://sharepoint/default.aspx";

  }

  else

  {

  alert("请输入正确的账号密码!");

  return false;

  }

  }

  catch (em)

  {

  alert(em.message);

  }

  }

  </script>

  </head>

  <body>

  <div>

  <form  method="post">

  用户名:

  <input id="username" type="text"  onkeypress="if(event.keyCode=='13'){document.getElementById('password').focus();}"/><br /><br />

  密码:

  <input id="password" type="text" onkeypress="if(event.keyCode=='13'){document.getElementById('btnLogin').click();}"/><br /><br /><br />

  <input id="btnLogin" type="button" value="登  陆"  onclick="return  DoSend('Http://sharepoint/');" /><br />

  </form>

  </div>

  <p>

  &nbsp;</p>

  </body>

  </html>

转载请注明:破洛洛(谢谢合作)
网友评论: