2018-10-09实习日记2

SCMain

<head runat="server">
    <title></title>

    <script src="../../Common/jquery-easyui-1.3.1/jquery-1.8.0.min.js" type="text/javascript"></script>

    <link href="../../CommonNew/css/main.css" rel="stylesheet" type="text/css" />

    <script src="../../CommonNew/js/Charts.js" type="text/javascript"></script>

</head>
<body>
    <div class="content_box" style="overflow-x: hidden; overflow-y: hidden">
        <div class="sy_state">
            <div class="item">
                <div class="left ic1">
                </div>
                <div class="right">
                    <h1 class="fclan">
                        在库传感器</h1>
                    <p>
                        总计:<span class="fclan"><asp:Label runat="server" ID="labSensorIn_TotalNum"></asp:Label></span>
                        个</p>
                    <p>
                        在线:<span class="fclan"><asp:Label runat="server" ID="labSensorIn_OnlinelNum"></asp:Label></span>
                        个</p>
                    <p>
                        离线:<span class="fclan"><a href="#" onclick="PostTheWebUrl('Node')" style="color: #36aeea;
                            margin-left: -5px;">
                            <asp:Label runat="server" ID="labSensorIn_OfflinelNum" Font-Underline="true"></asp:Label>
                        </a></span>个</p>
                    <p>
                        停用:<span class="fclan"><asp:Label runat="server" ID="labSensorIn_StopNum"></asp:Label></span>
                        个</p>
                </div>

                <script type="text/javascript">
                    function PostTheWebUrl(obj) {
                        if (obj == "Node") {
                            var myurl = "../../page/THSupervisionCenter/ScInStoreOfOutline.aspx";
                            window.location.assign(myurl);
                        }
                        else if (obj == "Car") {
                            var myurl = "../../page/THSupervisionCenter/ScOnPassageOfOutline.aspx";
                            window.location.assign(myurl);
                        }
                        else if (obj == "Deep") {
                            var myurl = "../../page/THSupervisionCenter/DeepfreezeOfOutline.aspx";
                            window.location.assign(myurl);
                        }

                        //                location.href = "../../page/SystemManage/AlertDataManage.aspx?a='1'";
                    }
                </script>

            </div>
            <div class="line">
            </div>
            <div class="item">
                <div class="left ic2">
                </div>
                <div class="right">
                    <h1 class="fczi">
                        在途冷链车辆</h1>
                    <p>
                        总计:<span class="fczi"><asp:Label runat="server" ID="labInRoad_TotalNum"></asp:Label></span>
                        个</p>
                    <p>
                        在线:<span class="fczi"><asp:Label runat="server" ID="labInRoad_OnlinelNum"></asp:Label></span>
                        个</p>
                    <p>
                        离线:<span class="fczi"> <a href="#" onclick="PostTheWebUrl('Car')" style="color: #897deb;
                            margin-left: -5px;">
                            <asp:Label runat="server" ID="labInRoad_OfflinelNum" Font-Underline="true"></asp:Label>
                        </a></span>个</p>
                    <p>
                        停用:<span class="fczi"><asp:Label runat="server" ID="labInRoad_NoUsed"></asp:Label></span>
                        个</p>
                </div>
            </div>
            <div class="line">
            </div>
            <div class="item">
                <div class="left ic3">
                </div>
                <div class="right">
                    <h1 class="fclv">
                        冷藏箱</h1>
                    <p>
                        总计:<span class="fclv"><asp:Label runat="server" ID="labFreezer_TotalNum"></asp:Label></span>
                        个</p>
                    <p>
                        在线:<span class="fclv"><asp:Label runat="server" ID="labFreezer_OnlinelNum"></asp:Label></span>
                        个</p>
                    <p>
                        离线:<span class="fclv"> <a href="#" onclick="PostTheWebUrl('Deep')" style="color: #67ba2f;
                            margin-left: -5px;">
                            <asp:Label runat="server" ID="labFreezer_OfflinelNum" Font-Underline="true"></asp:Label>
                        </a></span>个</p>
                    <p>
                        停用:<span class="fclv"><asp:Label runat="server" ID="labFreezer_StopNum"></asp:Label></span>
                        个</p>
                </div>
            </div>
        </div>
        <div class="sy_info">
            <div class="w95">
                <div class="left">
                    <div class="m1">
                        今日在库监测详情</div>
                    <div class="m2">
                        <div class="time">
                            <div class="ic1">
                            </div>
                            <div class="num">
                                <asp:Label ID="labAccumulatedNewAlarmDuration" runat="server"></asp:Label></div>
                            <div class="info">
                                报警累计时长</div>
                        </div>
                        <div class="time">
                            <div class="ic2">
                            </div>
                            <div class="num">
                                <a href="#" onclick="PostWebUrl()" style="color: #36aeea;">
                                    <asp:Label ID="labNewAlarmTimes" runat="server" Font-Underline="true">
                                    </asp:Label>
                                </a>次</div>
                            <div class="info">
                                新增报警</div>
                        </div>
                    </div>

                    <script type="text/javascript">
                        function PostWebUrl() {
                            var myurl = "../../page/SystemManage/AlertDataManage.aspx" + "?" + "id=Alarm";
                            window.location.assign(myurl);

                            //                location.href = "../../page/SystemManage/AlertDataManage.aspx?a='1'";
                        }
                    </script>

                    <div class="m3">
                        <div class="t1">
                            概述</div>
                        <div class="t2">
                            连续监测时长:<span><asp:Label ID="labAccumulatedDuration" runat="server"></asp:Label></span></div>
                        <div class="t2">
                            监测系统应用活跃度:<span><asp:Label ID="labLiveness" runat="server" Text="#95分"></asp:Label></span></div>
                    </div>
                </div>
                <div class="right">
                    <div class="m1">
                        <div class="title">
                            今日在库报警处理</div>
                    </div>
                    <div class="m2">
                        <!--圆形进度条-->
                        <div class="chart">
                            <div class="uncomplete">
                                已处理:<asp:Label ID="labDeal1" runat="server"></asp:Label>%</div>
                            <div class="complete">
                                未处理:<asp:Label ID="labUnDeal1" runat="server"></asp:Label>%</div>
                            <canvas id="pie1" width="100px" height="100px"></canvas>
                        </div>
                        <!--圆形进度条-->
                    </div>
                </div>
            </div>
        </div>
        <div class="sy_info">
            <div class="w95">
                <div class="left">
                    <div class="m1">
                        今日在途监测详情</div>
                    <div class="m2">
                        <div class="time">
                            <div class="ic1">
                            </div>
                            <div class="num">
                                <asp:Label ID="labAccumulatedNewAlarmDuration2" runat="server"></asp:Label></div>
                            <div class="info">
                                报警累计时长</div>
                        </div>
                        <div class="time">
                            <div class="ic2">
                            </div>
                            <div class="num">
                                <a href="#" onclick="PostWebUrl()" style="color: #36aeea;">
                                    <asp:Label ID="labNewAlarmTimes2" runat="server" Font-Underline="true"></asp:Label>
                                </a>次</div>
                            <div class="info">
                                新增报警</div>
                        </div>
                    </div>
                    <div class="m3">
                        <div class="t1">
                            概述</div>
                        <div class="t2">
                            连续监测时长:<span><asp:Label ID="labAccumulatedDuration2" runat="server"></asp:Label></span></div>
                        <div class="t2">
                            发运次数:<span><asp:Label ID="labSendTimes2" runat="server"></asp:Label>次</span></div>
                    </div>
                </div>
                <div class="right">
                    <div class="m1">
                        <div class="title">
                            今日在途报警处理</div>
                    </div>
                    <div class="m2">
                        <!--圆形进度条-->
                        <div class="chart">
                            <div class="uncomplete">
                                已处理:<asp:Label ID="labDeal2" runat="server"></asp:Label>%</div>
                            <div class="complete">
                                未处理:<asp:Label ID="labUnDeal2" runat="server"></asp:Label>%</div>
                            <canvas id="pie2" width="100px" height="100px"></canvas>
                        </div>
                        <!--圆形进度条-->
                    </div>
                </div>
            </div>
        </div>
        <div class="sy_info">
            <div class="w95">
                <div class="left">
                    <div class="m1">
                        今日冷藏箱监测详情</div>
                    <div class="m2">
                        <div class="time">
                            <div class="ic1">
                            </div>
                            <div class="num">
                                <asp:Label ID="labAccumulatedNewAlarmDuration3" runat="server"></asp:Label></div>
                            <div class="info">
                                报警累计时长</div>
                        </div>
                        <div class="time">
                            <div class="ic2">
                            </div>
                            <div class="num">
                                <a href="#" onclick="PostWebUrl()" style="color: #36aeea;">
                                    <asp:Label ID="labNewAlarmTimes3" runat="server" Font-Underline="true"></asp:Label>
                                </a>次</div>
                            <div class="info">
                                新增报警</div>
                        </div>
                    </div>
                    <div class="m3">
                        <div class="t1">
                            概述</div>
                        <div class="t2">
                            连续监测时长:<span><asp:Label ID="labAccumulatedDuration3" runat="server"></asp:Label></span></div>
                        <div class="t2">
                            发运次数:<span><asp:Label ID="labSendTimes3" runat="server"></asp:Label>次</span></div>
                    </div>
                </div>
                <div class="right">
                    <div class="m1">
                        <div class="title">
                            今日冷藏箱报警处理</div>
                    </div>
                    <div class="m2">
                        <!--圆形进度条-->
                        <div class="chart">
                            <div class="uncomplete">
                                已处理:<asp:Label ID="labDeal3" runat="server"></asp:Label>%</div>
                            <div class="complete">
                                未处理:<asp:Label ID="labUnDeal3" runat="server"></asp:Label>%</div>
                            <canvas id="pie3" width="100px" height="100px"></canvas>
                        </div>
                        <!--圆形进度条-->
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">


        var dataEquip = null;

        $(document).ready(function() {

            $.ajax(
        {
            type: 'POST',
            url: 'SCMain.aspx',
            dataType: 'text',
            data: { Action: 'EquipAlarmDeal' },
            cache: false,
            success: function(res) {
                dataEquip = eval('(' + res + ')');

                var Deal = dataEquip[0][1];
                var UnDeal = dataEquip[1][1];

//                var a = parseFloat(Deal);
//                var b = parseFloat(UnDeal);

//                var d = a + b;
//                var c = (a / d).toFixed(2);
//                var e = 1 - c;
//                c = c * 100;
//                e = e * 100;

//                new Chart("pie1").ratePie(c);

//                document.getElementById("labDeal1").innerHTML = c;
                //                document.getElementById("labUnDeal1").innerHTML = e;
                new Chart("pie1").ratePie(Deal);
                document.getElementById("labDeal1").innerHTML = Deal;
                document.getElementById("labUnDeal1").innerHTML = UnDeal;
            }
        });



            $.ajax(
        {
            type: 'POST',
            url: 'SCMain.aspx',
            dataType: 'text',
            data: { Action: 'CarAlarmDeal' },
            cache: false,
            success: function(res) {
                dataEquip = eval('(' + res + ')');

                var Deal = dataEquip[0][1];
                var UnDeal = dataEquip[1][1];

//                var a = parseFloat(Deal);
//                var b = parseFloat(UnDeal);

//                var d = a + b;
////                var c = (a / d).toFixed(2);
////                var e = 1 - c;
////                c = c * 100;
////                e = e * 100;
//                var c = Math.round(a / d *100);
//                var e = 100 - c;

//                new Chart("pie2").ratePie(c);

//                document.getElementById("labDeal2").innerHTML = c;
                //                document.getElementById("labUnDeal2").innerHTML = e;
                new Chart("pie2").ratePie(parseInt( Deal,10) );
                document.getElementById("labDeal2").innerHTML = Deal;
                document.getElementById("labUnDeal2").innerHTML = UnDeal;
            }
        });


            $.ajax(
        {
            type: 'POST',
            url: 'SCMain.aspx',
            dataType: 'text',
            data: { Action: 'CoolBoxAlarmDeal' },
            cache: false,
            success: function(res) {
                dataEquip = eval('(' + res + ')');

                var Deal = dataEquip[0][1];
                var UnDeal = dataEquip[1][1];

//                var a = parseFloat(Deal);
//                var b = parseFloat(UnDeal);

//                var d = a + b;
//                var c = (a / d).toFixed(2);
//                var e = 1 - c;
//                c = c * 100;
//                e = e * 100;

//                new Chart("pie3").ratePie(c);

                //                document.getElementById("labDeal3").innerHTML = c;
                //                document.getElementById("labUnDeal3").innerHTML = e;
                new Chart("pie3").ratePie(Deal);
                document.getElementById("labDeal3").innerHTML = Deal;
                document.getElementById("labUnDeal3").innerHTML = UnDeal;
            }
        });
        });
    </script>

</body>

注册界面

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="THMS.page.Register"
    EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../CommonNew/css/main.css" rel="stylesheet" type="text/css"></link>

    <script src="../CommonNew/js/wow.js" type="text/javascript"></script>

    <script src="../CommonNew/js/login.js" type="text/javascript"></script>

    <link href="../CommonNew/css/animate.min.css" rel="stylesheet" type="text/css"></link>

    <script src="../Common/jquery-easyui-1.3.1/jquery-1.8.0.min.js" type="text/javascript"></script>

    <script src="../Common/jquery-easyui-1.5/jquery.easyui.min.js" type="text/javascript"></script>

    <link href="../Common/jquery-easyui-1.5/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../Common/jquery-easyui-1.5/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />
    <title></title>

    <script>
        if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
            new WOW().init();
        };
    </script>

    <style type="text/css">
        body
        {
            background: url(../CommonNew/images/login_bg.jpg) no-repeat left #fff;
            background-position: center top;
            background-size: cover;
        }
    </style>

    <script type="text/javascript" language="javascript">
        $(function() {
            $("#Phone").val("请输入手机号");
            $("#yzmid").val("请输入短信验证码");
            $("#password1").val("请输入新密码");
            $("#password2").val("请输入新密码");
            document.getElementById("GetYZMBtn").style.backgroundColor = "#2177c6";
            document.getElementById("GetYZMBtn").style.color = "#fff";

            /**
            *刷新图片验证码
            */
            $("#freshVerify").click(function() {
                var element = document.getElementById('verify');
                element.src = "../Common/Controls/Verify.ashx?" + Math.random();
            })
            /**
            *刷新图片验证码
            */
            $("#verify").click(function() {
                var element = document.getElementById('verify');
                element.src = "../Common/Controls/Verify.ashx?" + Math.random();
            })
        });
        var strCheckCode = "";


        function SendYZM(btn) {
            //            document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
            var PhoneNum = $("#Phone").val();
            var myDate = new Date();
            var NowTime = myDate.toLocaleString();
            strCheckCode = NowTime.replace(/[^0-9]/ig, "");
            //            document.getElementById("<%=Message.ClientID %>").innerHTML = "";
            if (PhoneNum.length != 11) {
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "请检查手机号";
                wait = 0;
                Delay(3);
                return;
            }
            var strVerify = $("#txtVerify").val();
            if (strVerify == "" || strVerify == "请输入验证码") {
                document.getElementById("<%=verifyMessage.ClientID %>").innerHTML = "请输入图片验证码";
                wait = 0;
                Delay(3);
                return;
            }
            $.ajax(
            {
                type: 'POST',
                url: 'Register.aspx',
                dataType: 'text',
                data: { Action: 'CheckCode', strVerify: strVerify },
                cache: false,
                success: function(strs) {
                    if (strs != "0") {
                        document.getElementById("<%=verifyMessage.ClientID %>").innerHTML = "验证码不正确";
                        wait = 0;
                        Delay(3);
                    } else {
                        //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                        $.ajax(
                        {
                            type: 'POST',
                            url: 'Register.aspx',
                            dataType: 'text',
                            data: { Action: 'GetVali', PhoneNum: PhoneNum, strCheckCode: strCheckCode },
                            cache: false,
                            beforeSend: function ShowdivShowChangeQueryInfo() { $("#OKSendValidate").show() },
                            success: function(strs) {
                                if (strs != "") {
                                    if (strs == "0") {
                                        //                                    alert("验证码已发送");
                                        document.getElementById("<%=Message.ClientID %>").innerHTML = "验证码已发送";
                                        wait = 60;
                                    }
                                    else if (strs == "1") {
                                        //                                    alert("验证码发送失败");
                                        document.getElementById("<%=Message.ClientID %>").innerHTML = "验证码发送失败";
                                        wait = 0;
                                    }
                                    else if (strs == "2") {
                                        //                                    alert("当天发送次数超过三次");
                                        document.getElementById("<%=Message.ClientID %>").innerHTML = "当天发送次数超过三次";
                                        wait = 0;
                                    }
                                    else if (strs == "3") {
                                        //                                    alert("当前手机号已注册");
                                        document.getElementById("<%=Message.ClientID %>").innerHTML = "当前手机号已注册";
                                        wait = 0;
                                    }
                                }
                                else {
                                    //                                alert("未知错误,请联系管理员");
                                    document.getElementById("<%=Message.ClientID %>").innerHTML = "未知错误,请联系管理员";
                                    wait = 0;
                                }
                                Delay(3);
                                time(btn);
                            },
                            complete: function HidedivShowChangeQueryInfo() { $("#OKSendValidate").hide() }
                        });
                    }
                }
            })
        }
        function IsNum(num) {
            var reNum = /^\+?[1-9][0-9]*$/;
            return (reNum.test(num));
        }
        function IsPhoneNum(num) {
            var reNum = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
            return (reNum.test(num));
        }

        function register() {
            //            document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
            //            document.getElementById("<%=Message.ClientID %>").innerHTML = "";
            //            document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "";
            //            document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "";
            //            document.getElementById("<%=RegisterOKMessage.ClientID %>").innerHTML = "";
            //            debugger;
            var strPhoneNum = $("#Phone").val();
            var strValidate = $("#yzmid").val();
            var strPsd1 = $("#password1").val();
            var strPsd2 = $("#password2").val();
            if (strPhoneNum.length != 11 || (!IsPhoneNum(strPhoneNum))) {
                //                alert("请检查手机号");
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "请检查手机号";
            }
            else if (strPhoneNum == "") {
                //                alert("请输入手机号");
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "请输入手机号";
            }
            else if (strValidate == "" || strValidate == "验证码") {
                //                alert("请输入验证码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=Message.ClientID %>").innerHTML = "请输入验证码";
            }
            else if (strCheckCode == "") {
                //                alert("请重新获取验证码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=Message.ClientID %>").innerHTML = "请重新获取验证码";
            }
            else if (strPsd1 == "" || strPsd1 == "请输入新密码") {
                //                alert("请检查密码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "请检查密码";
            }
            else if (strPsd2 == "" || strPsd2 == "请输入新密码") {
                //                alert("请检查密码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=Message.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "请检查密码";
            }
            else if (strPsd1 != strPsd2) {
                //                alert("两次密码输入不同");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=Message.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "两次密码输入不同";
            }
            else if (!(document.getElementById("CheckSure").checked)) {
                //                alert("请检查是否同意用户协议");
                //                document.getElementById("<%=RegisterOKMessage.ClientID %>").innerHTML = "请检查是否同意用户协议";
                document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "请检查是否同意用户协议";
            }
            else {
                //                document.getElementById("<%=RegisterOKMessage.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=Message.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "";
                //                document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "";
                $.ajax(
                    {
                        type: 'POST',
                        url: 'Register.aspx',
                        dataType: 'text',
                        data: { Action: 'Add', strPhoneNum: strPhoneNum, strCheckCode: strCheckCode, strValidate: strValidate, strPassword: strPsd2 },
                        cache: false,
                        beforeSend: function ShowdivShowChangeQueryInfo() { $("#OKDiv").show() },
                        success: function(strs) {
                            if (strs != "") {
                                if (strs == "1") {
                                    alert("注册成功,请等待管理员审核!");
                                    window.location.href = "homeLogin.aspx";
                                    //                                    document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "注册成功,请等待管理员审核!";
                                }
                                else {
                                    //                                    alert("验证码输入错误");
                                    document.getElementById("<%=Message.ClientID %>").innerHTML = "注册失败,请重新注册";
                                    $("#yzmDiv").show();
                                    $("#PwdDiv").hide();
                                }
                            }
                            else {
                                //                                alert("未知错误,请联系管理员");
                                $("#yzmDiv").show();
                                $("#PwdDiv").hide();
                                document.getElementById("<%=Message.ClientID %>").innerHTML = "未知错误,请联系管理员";
                            }
                            Delay(3);

                        },
                        complete: function HidedivShowChangeQueryInfo() { $("#OKDiv").hide() }
                    });
            }
            Delay(3);
        }
        function Validate() {
            //            $("#yzmDiv").hide();
            //            $("#PwdDiv").show();
            var strPhoneNum = $("#Phone").val();
            var strValidate = $("#yzmid").val();
            if (strPhoneNum.length != 11 || (!IsPhoneNum(strPhoneNum))) {
                //                alert("请检查手机号");
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "请检查手机号";
            }
            else if (strPhoneNum == "") {
                //                alert("请输入手机号");
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "请输入手机号";
            }
            else if (strValidate == "" || strValidate == "请输入短信验证码") {
                //                alert("请输入验证码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=Message.ClientID %>").innerHTML = "请输入短信验证码";
            }
            else if (strCheckCode == "") {
                //                alert("请重新获取验证码");
                //                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=Message.ClientID %>").innerHTML = "请重新获取短信验证码";
            }
            else {
                $.ajax(
                    {
                        type: 'POST',
                        url: 'Register.aspx',
                        dataType: 'text',
                        data: { Action: 'ValidateCode', strPhoneNum: strPhoneNum, strCheckCode: strCheckCode, strValidate: strValidate },
                        cache: false,
                        beforeSend: function ShowdivShowChangeQueryInfo() { $("#OKDiv").show() },
                        success: function(strs) {
                            if (strs != "") {
                                if (strs == "1") {
                                    $("#yzmDiv").hide();
                                    $("#PwdDiv").show();
                                }
                                else {
                                    //                                    alert("验证码输入错误");
                                    document.getElementById("<%=Message.ClientID %>").innerHTML = "验证码输入错误";
                                    Delay(3);
                                }
                            }
                        },
                        complete: function HidedivShowChangeQueryInfo() { $("#OKDiv").hide() }
                    });
            }
            Delay(3);
        }
        var wait = 60;
        function time(btn) {
            if (wait == 0) {
                btn.removeAttribute("disabled");
                btn.value = "获取短信验证码";
                wait = 60;
                document.getElementById("GetYZMBtn").style.backgroundColor = "#2177c6";
                document.getElementById("GetYZMBtn").style.color = "#fff";
            } else {
                btn.setAttribute("disabled", true);
                btn.value = wait + "秒后重新获取验证码";
                wait--;
                document.getElementById("GetYZMBtn").style.backgroundColor = "#e3e3e3";
                document.getElementById("GetYZMBtn").style.color = "#919191";
                setTimeout(function() {
                    time(btn);
                },
                1000)
            }
        }

        function Delay(time) {
            if (time > 0) {
                time--;
                setTimeout(function() {
                    Delay(time);
                },
                1000);
            }
            else {
                document.getElementById("<%=psd1Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=psd2Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=RegisterOKMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=Message.ClientID %>").innerHTML = "";
                document.getElementById("<%=PhoneMessage.ClientID %>").innerHTML = "";
                document.getElementById("<%=verifyMessage.ClientID %>").innerHTML = "";
            }
        }        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="outer">
        <div id="middle">
            <div id="inner">
                <div class="reg_form">
                    <div class="dv_cc">
                        <div class="login" id="con_one_2" style="height: 380px;">
                            <div class=" wow flipInY">
                                <div class="t1">
                                    <span class="fchuang">我有账号,立即<a href="homeLogin.aspx">登陆</a></span>
                                </div>
                                <div id="yzmDiv">
                                    <div class="item">
                                        <input type="text" class="user" id="Phone" value="请输入手机号" onfocus="if (value =='请输入手机号'){value =''}"
                                            onblur="if (value ==''){value='请输入手机号'}" />
                                        <%--<input class="easyui-textbox" id="Phone" data-options="prompt:'请输入手机号',iconCls:'icon-man',iconWidth:38">--%>
                                        <asp:Label ID="PhoneMessage" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label>
                                    </div>
                                    <div class="item">
                                        <input type="text" class="yzm" id="txtVerify" value="请输入验证码" onfocus="if (value =='请输入验证码'){value =''}"
                                            onblur="if (value ==''){value='请输入验证码'}" />
                                        <img src="../../CommonNew/images/icon_fresh.png" style="width: 25px; height: 25px;
                                            margin-top: 15px; float: right" id="freshVerify" />
                                        <img src='../Common/Controls/Verify.ashx' style="width: 70px; height: 38px; float: right;
                                            line-height: 58px; margin-top: 10px; margin-right: 5px;" id="verify" />
                                        <span>
                                            <asp:Label ID="verifyMessage" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label>
                                        </span>
                                    </div>
                                    <div class="item">
                                        <input type="text" class="yzm" id="yzmid" value="请输入短信验证码" onfocus="if (value =='请输入短信验证码'){value =''}"
                                            onblur="if (value ==''){value='请输入短信验证码'}" />
                                        <input type="button" id="GetYZMBtn" value="获取短信验证码" onclick="SendYZM(this);return false;"
                                            class="sent_ok" />
                                        <%--<input class="easyui-textbox" id="SendMes" data-options="buttonText:'发送验证码',prompt:'短信验证码'">--%>
                                        <span id="OKSendValidate" style="width: 40px; margin-left: 10px; display: none;">
                                            <img src="../../Common/Image/loading.gif" />
                                        </span><span>
                                            <asp:Label ID="Message" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label>
                                        </span>
                                    </div>
                                    <div class="login_btn ">
                                        <input type="submit" id="Submit1" value="立即验证" onclick="Validate();return false;"
                                            class="jh_img login_btn " />
                                        <%--<asp:LinkButton ID="btn" runat="server" ForeColor="White" OnClientClick="register();return false;">立即找回</asp:LinkButton>--%>
                                        <span id="OKdiv" style="width: 200px; margin-left: 10px; display: none;">
                                            <img src="../../Common/Image/loading.gif" /></span>
                                        <asp:Label ID="Label1" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label>
                                    </div>
                                </div>
                                <div id="PwdDiv" style="display: none;">
                                    <div class="item">
                                        <input class="lock" value="请输入新密码" id="password1" type="password" onfocus="if (value =='请输入新密码'){value =''}"
                                            onblur="if (value ==''){value='请输入新密码'}" />
                                        <%--<input class="easyui-textbox" id="password1" type="password" data-options="prompt:'请输入新密码',iconCls:'icon-lock',iconWidth:38">--%>
                                        <span>
                                            <asp:Label ID="psd1Message" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label></span>
                                    </div>
                                    <div class="item">
                                        <input class="lock" id="password2" value="请输入新密码" type="password" onfocus="if (value =='请输入新密码'){value =''}"
                                            onblur="if (value ==''){value='请输入新密码'}" />
                                        <%--<input class="easyui-textbox" id="password2" type="password" data-options="prompt:'请输入新密码',iconCls:'icon-lock',iconWidth:38">--%>
                                        <span>
                                            <asp:Label ID="psd2Message" runat="server" ForeColor="Red" Font-Size="12px" Text=''></asp:Label></span>
                                    </div>
                                    <div class="login_btn ">
                                        <input type="submit" id="btn" value="立即注册" onclick="register();return false;" class="jh_img login_btn " />
                                        <%--<asp:LinkButton ID="btn" runat="server" ForeColor="White" OnClientClick="register();return false;">立即找回</asp:LinkButton>--%>
                                        <span id="OKdiv" style="width: 200px; margin-left: 10px; display: none;">
                                            <img src="../../Common/Image/loading.gif" /></span>
                                        <asp:Label ID="RegisterOKMessage" runat="server" ForeColor="Red" Font-Size="12px"
                                            Text=''></asp:Label>
                                    </div>
                                    <div class="wan">
                                        <div class="t1">
                                            <input type="checkbox" id="CheckSure" checked="checked" class="chk_1" />
                                            <label for="CheckSure">
                                            </label>
                                        </div>
                                        <div class="t2 ">
                                            我已阅读并同意<span class="fwb"><a href="fcf">《用户注册协议》</a></span></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="reg_copyright">
        <div class="w1200">
            <div class="app_down_btn">
                <div class="center">
                    <a href="#" class="az">Android 客户端下载</a> <a href="#" class="pg">iPhone客户端下载</a>
                </div>
            </div>
            <div class="gs_info">
                © 2007~2016 京ICP备15066634号 北京国尚信科技有限公司</div>
            <div class="gs_info">
                中国<span>·</span>北京<span>·</span>海淀</div>
        </div>
    </div>
    </form>
</body>
</html>

后台代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using BasicItem;
using System.Text;
using MenuUtility;
using BasicItem.BasicCommon;
using System.Data;

namespace THMS.page
{
    public partial class Register : System.Web.UI.Page
    {
        private RegisterBLL _Common = new RegisterBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["Action"] != null)
            {
                string returnMsg = string.Empty;
                StringBuilder returngvwMsg = new StringBuilder();
                switch (Request["Action"])
                {
                    case "GetVali":
                        returnMsg = getValidateCode(Request["PhoneNum"].ToString(), Request["strCheckCode"].ToString());
                        Response.Write(returnMsg);
                        break;
                    case "ValidateCode":
                        returnMsg = checkValidateCode(Request["strPhoneNum"].ToString(), Request["strCheckCode"].ToString(), Request["strValidate"].ToString());
                        Response.Write(returnMsg);
                        break;
                    case "Add":
                        returnMsg = RegisterUserInfo(Request["strPhoneNum"].ToString(), Request["strCheckCode"].ToString(), Request["strValidate"].ToString(), Request["strPassword"].ToString());
                        Response.Write(returnMsg);
                        break;
                    case "CheckCode":
                        returnMsg = CheckCode(Request["strVerify"].ToString());
                        Response.Write(returnMsg);
                        break;
                }
                Response.ContentType = "text/xml";
                Response.Expires = 0;
                Response.Flush();
                Response.End();
            }
        }


        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <param name="LogionInfor"></param>
        /// <param name="strPhoneNo"></param>
        /// <param name="strCheckCode"></param>
        /// <returns>0:发送成功  1:发送失败  2:超过当日发送次数  3:手机号已注册</returns>
        public string getValidateCode(string strPhoneNo, string strCheckCode)
        {
            RegisterBLL _RegisterBLL = new RegisterBLL();
            return _RegisterBLL.getValidateCode(strPhoneNo, strCheckCode);
        }

        /// <summary>
        /// 检查验证码(注册用户)
        /// </summary>
        /// <param name="LogionInfor"></param>
        /// <param name="strPhoneNo"></param>
        /// <param name="strCheckCode"></param>
        /// <param name="strValidateCode"></param>
        /// <returns>true:验证成功  false:验证码不正确</returns>
        public string checkValidateCode(string strPhoneNo, string strCheckCode, string strValidateCode)
        {
            if (_Common.checkValidateCode(strPhoneNo, strCheckCode, strValidateCode))
            {
                return "1";
            }
            else
            {
                //验证失败
                return "0";
            }
        }
        /// <summary>
        /// 检查验证码(注册用户)
        /// </summary>
        /// <param name="LogionInfor"></param>
        /// <param name="strPhoneNo"></param>
        /// <param name="strCheckCode"></param>
        /// <param name="strValidateCode"></param>
        /// <returns>true:注册成功  false:注册失败</returns>
        public string RegisterUserInfo(string strPhoneNo, string strCheckCode, string strValidateCode, string strPassword)
        {
            string Password = new MD5Encrypt().EncryptMD5Str(strPassword).Replace("'", "\"");
            if (_Common.checkValidateCode(strPhoneNo, strCheckCode, strValidateCode))
            {
                //验证成功,注册用户
                if (_Common.RegisterUserInfo(strPhoneNo, Password, "1"))
                {
                    return "1";
                }
                else return "0";
            }
            else
                return "0";
        }


        public string CheckCode(string txtVerify)
        {
           return String.Compare(Session["Codegif"].ToString(), txtVerify, true).ToString();
        }
    }
}
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,194评论 6 490
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,058评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,780评论 0 346
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,388评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,430评论 5 384
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,764评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,907评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,679评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,122评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,459评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,605评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,270评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,867评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,734评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,961评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,297评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,472评论 2 348

推荐阅读更多精彩内容