通用用户权限管理系统组件4.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;
            }
        }
原文地址:https://www.cnblogs.com/jirigala/p/3531198.html