防止页面在跳转的时候被SQL注入
首先写一个SQL注入过滤的类:
public class SqlFilter
{
#region SQL注入式攻击代码分析
/// <summary>
/// 处理用户提交的请求
/// </summary>
public void StartProcessRequest()
{
string getkeys = "";
string sqlErrorPage = "~/no.html";//转向的错误提示页面
try
{
if (System.Web.HttpContext.Current.Request.QueryString != null)
{
for (int i = 0; i < System.Web.HttpContext.Current.Request.QueryString.Count; i++)
{
getkeys = System.Web.HttpContext.Current.Request.QueryString.Keys[i];
if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.QueryString[getkeys]))
{
System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage,false);
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
//System.Web.HttpContext.Current.Response.End();
}
}
}
if (System.Web.HttpContext.Current.Request.Form != null)
{
for (int i = 0; i < System.Web.HttpContext.Current.Request.Form.Count; i++)
{
getkeys = System.Web.HttpContext.Current.Request.Form.Keys[i];
if (getkeys == "__VIEWSTATE") continue;
if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.Form[getkeys]))
{
System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage,false);
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
//System.Web.HttpContext.Current.Response.End();
相关文档:
[code=SQL][/code]
--语 句 功 能
--数据操作
SELECT --从数据库表中检索数据行和列
INSERT --向数据库表添加新数据行
DELETE --从数据库表中删除数据行
UPDATE --更新数据库表中的数据
--数据定义
CREATE TABLE --创建一个数据库表
DROP TABLE --从数据 ......
CONVERT 函数 [数据类型转换]
--------------------------------------------------------------------------------
功能
返回转换成提供的数据类型的表达式。
语法
CONVERT ( data type, expression [ , format-style ] )
参数
data&nbs ......
◆1.DBCC CacheStats :显示存在于当前 buffer Cache 中的对象的信息,例如 :hitrates 编译的对象和执行计划
DBCC CACHESTATS
从这个命令可以得到一些关键的统计信息:
Hit Ratio:显示特定对象可以在Sql Server的缓存中被命中的百分比,这个数值越大,越好
Object Count:显 ......
我理解的SQL Server 2005镜像配置实际上就是由三个服务器(也可以是同一服务器的三个 SQL 实例)组成的一个保证数据的环境,分别是:主服务器、从服务器、见证服务器。
主服务器:数据存放的地方
从服务器:数据备份的地方(即:主服务器的镜像)
见证服务器:动态调配主/从服务器的第三方服务器
环境介绍
首先介 ......
/*********************************************************/
目录清单CONTEXT LIST
/*********************************************************/
1.数据库DataBase
1.1数据库建立/删除create/drop database
1.2数据库备份与恢复backup/restore database
/***************************************************** ......