zoukankan      html  css  js  c++  java
  • 通过Javascript模拟登陆Windows认证的网站

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>模拟登陆</title>
        <script type="text/javascript">
            var xmlHttp;
            function createXMLHttpRequest() {
                if (window.ActiveXObject) {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                else if (window.XMLHttpRequest) {
                    xmlHttp = new XMLHttpRequest();
                }
            }
    
            function startRequest() {
                if (userid.value == "") {
                    alert("请输入用户名!");
                    userid.focus();
                }
                else if (password.value == "") {
                    alert("请输入密码!");
                    password.focus();
                }
                else {
                    createXMLHttpRequest();
                    xmlHttp.onreadystatechange = handleStateChange;
                    xmlHttp.open("GET", "http://yx-pc/MySite/Person.aspx", true, userid.value, password.value);
                    xmlHttp.send(null);
                }
            }
    
            function handleStateChange() {
                if (xmlHttp.readyState == 4) {
                    if (xmlHttp.status == 200) {
                        window.location = "http://yx-pc/MySite/Person.aspx";
                    }
                    else {
                        alert("您的用户名或者密码不正确,请联系管理员!");
                    }
                }
            }
        </script>
    </head>
    <body>
        <p>
            UserId:<input type="text" name="userid">
        </p>
        <p>
            Password:<input type="password" name="password">
        </p>
        <p>
            <input type="submit" name="Submit" value="提交" onclick="javascript:startRequest();">
        </p>
    </body>
    </html>
  • 相关阅读:
    JSONModel的使用
    gitHub那些优秀的库和想要实现的效果
    CALayer的mask属性
    透明的UITableView
    iOS 常用随机数
    UIView的 形变属性transform
    ARGB色彩模式
    封闭折线图形的渐变色
    iOS系统日历选择问题
    每天积累一点新知识
  • 原文地址:https://www.cnblogs.com/tomz/p/3437524.html
Copyright © 2011-2022 走看看