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
相关文档:
Sql代码
--采用SQL语句实现sql2005和Excel 数据之间的数据导入导出,在网上找来一--下,实现方法是这样的:
--Excel---->SQL2005 导入:
select * into useinfo from O ......
首页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//数据库地址
private string datapatch = "db/global.asa";//数据库地址
///
/// 取得dataset
//
/// 查询语句
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
查看回收站中表
select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin;
恢复表
SQL>flashback table test_drop to before drop;或
SQL>flashback table "BIN$b+XkkO1RS5K10uKo9BfmuA==$0" to before drop;
......
提高数据库性能的方式有两种
一、一种是DBA通过对数据库的各个方面调优
调整数据库:共享池,java池,高速缓存,大型池,java池
针对于window操作系统 32位,oracle内存占用,最大为1.7G,超过则不作用,因此这几项值之和不应超过1.7G
目前各池参数为:
......