ASP.NET防止SQL注入函数
ASP.NET防止SQL注入函数:
using System;
using System.Text.RegularExpressions;
using System.Web;
namespace FSqlKeyWord
......{
/**//**//**//// <summary>
/// SqlKey 的摘要说明。
/// </summary>
public class SqlKey
......{
private HttpRequest request;
private const string StrKeyWord = @"select|insert|delete|from|count(|drop table|update|truncate|asc(|mid(|char(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
private const string StrRegex = @"[-|;|,|/|(|)|[|]|}|{|%|@|*|!|']";
public SqlKey(System.Web.HttpRequest _request)
......{
//
// TODO: 在此处添加构造函数逻辑
//
this.request = _request;
}
/**//**//**//// <summary>
/// 只读属性 SQL关键字
/// </summary>
public static string KeyWord
......{
get
......{
return StrKeyWord;
}
}
&nbs
相关文档:
用select语句,查询重复记录
假设,表名为 T1 子段为 A,B,C
select count(*) ,A,B,C from T1
group by A,B,C having count(*) > 1
测试数据:
A100 B100 C100&nbs ......
提高数据库性能的方式有两种
一、一种是DBA通过对数据库的各个方面调优
调整数据库:共享池,java池,高速缓存,大型池,java池
针对于window操作系统 32位,oracle内存占用,最大为1.7G,超过则不作用,因此这几项值之和不应超过1.7G
目前各池参数为:
......
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is ......
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attribute ......