权限管理、用户权限系统、开源用户权限系统、信息化建设标准基础数据管理平台
代码改变世界

通用用户权限管理系统组件4.0 版本 - 界面输入安全检查 - 为大规模开发软件系统做样例

2014-01-23 15:05  通用C#系统架构  阅读(1540)  评论(0编辑  收藏  举报

公司要进行大规模软件系统开发,需要把一些关键的例子程序都写写好,为了加强软件系统的安全性,做了界面输入内容的安全性检查,下面是程序的运行效果。

安全性检查的代码参考如下

        private bool CheckInputSearch()
        {
            bool result = true;
            if (!BaseCheckInput.SqlSafe(this.txtSearch.Text))
            {
                this.txtSearch.SelectAll();
                this.txtSearch.Focus();
                result = false;
            }
            return result;
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (this.CheckInputSearch())
            {
                // 设置鼠标繁忙状态,并保留原先的状态
                Cursor holdCursor = this.Cursor;
                this.Cursor = Cursors.WaitCursor;
                this.FormLoaded = false;
                // 设置查询条件
                this.Search();
                this.SetSearch();
                this.FormLoaded = true;
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
        }

 

 



C# ASP.NET 通用权限设计、通用权限管理、通用权限组件、单点登录、集中式权限管理、统一授权体系、分级管理分级授权


微信扫一扫加好友