Aspx登录界面,输入验证码

该博客介绍了如何在ASPX页面中实现登录界面的验证码功能,包括后台生成验证码的步骤,参考了相关博客资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Log1n.aspx.cs" Inherits="MaYi.Web.Log1n" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>蚂蚁OA流程系统</title>
    <script type="text/javascript" src="login/jquery.min.js?v=<%=MaYi.Common.Constant.JsVersion%>"></script>
    <style>
        * {
            font-family: "微软雅黑","宋体","Arial";
            color: #333;
            margin: 0px;
            padding: 0px;
            font-size: 14px;
        }

        body.bg {
            background: #f9f9f9;
            width: 100%;
            height: 100%;
        }

        .login {
            width: 430px;
            height: 380px;
            position: absolute;
            left: 50%;
            margin: 0 0 0 -192px;
            top: 20%;
            padding: 0 0px 6px;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
        }

            .login .login-btn {
                border-radius: 4px;
                margin-left: 50px;
            }

        .header span {
            color: #fff;
            font-family: "Microsoft YaHei";
            font-size: 18px;
            margin-left: 8px;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
        }

        .login label {
            display: block;
            height: 42px;
            color: rgba(0, 0, 0, 0.6);
            font-family: "Microsoft YaHei";
            line-height: 60px;
            font-size: 16px;
            margin-left: 50px;
            font-weight: bolder;
            margin-top: 0px;
        }

        .login input.text {
            width: 265px;
            height: 33px;
            background: none;
            border: none;
            line-height: 35px;
            padding-left: 10px;
            color: #333;
        }

        .login input.border {
            margin-bottom: 15px;
            /*border-color: #ff9900 #ff9900 #ff9900 -moz-use-text-color;*/
            border-width: 1px 1px 1px 0;
            border-color: #acc6e9 #acc6e9 #acc6e9 rgba(35, 106, 147, 0.84);
            border-style: solid solid solid none;
        }

        .login p {
            margin: 20px 0;
            color: #ccc;
        }

            .login p a.wjmm {
                float: right;
                color: #ff9900;
                text-decoration: underline;
            }

        .login a.btn {
            display: block;
            background: #78aaed;
            width: 100px;
            font-size: 18px;
            height: 45px;
            line-height: 45px;
            font-weight: normal;
            border-radius: 4px;
            text-align: center;
            color: #fff;
        }

            .login a.btn:hover {
                background: #2a7fef;
            }

        a {
            text-decoration: none;
        }

            a:hover {
                color: #3e1e1e;
                text-decoration: none;
            }

        img {
            border: none;
        }

        .blue {
            color: #006699;
        }

        .login .err-info {
            color: red;
        }



        table td {
            position: relative;
        }

        .header {
            background: #78aaed none repeat scroll 0 0;
            border-bottom: 1px solid #5c8fd3;
            height: 45px;
            padding-top: 5px;
            width: 100%;
        }

            .header h3 img {
                height: 30px;
            }

        .logo-img {
            margin-right: 3px;
        }

        .text-center {
            text-align: center;
        }

        .dl_yh_bg {
            background-color: #78aaed;
            /*background-color: #969696;*/
            display: inline-block;
            height: 35px;
            text-align: center;
            vertical-align: middle;
            width: 39px;
        }

        .dl_yh_pic {
            margin-top: 10px;
        }
    </style>
    <script type="text/javascript">
        (function ($) {
            $.getUrlParam = function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
        })(jQuery);
        $(document).keydown(function (event) {
            if (event.keyCode == 13) { //绑定回车
                login();
            }
        });
        $(function () {

            imgchange();
            $("#imgcode").click(function () {
                imgchange();
            });
            $('#yzm').val('');
            function imgchange() {
                var radom = "login/LoginHandler.ashx?type=validateCode&rr=" + Math.random();
                $("#imgcode").attr("src", radom);
            }
        });
        var f = true;
        function login() {

            //  $('#err-info').hide();
            if ($('#UserName').val() == "") {
                $('#UserName').focus();
                $('#err-info').html('请输入用户名!');

                return false;
            }
            else if ($('#pwd').val() == "") {
                $('#err-info').html('请输入密码!')
                $('#pwd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值