易截截图软件、单文件、免安装、纯绿色、仅160KB

asp防SQL注入函数


'SQL防注入函数,调用方法,在需要防注入的地方替换以前的request("XXXX")为SafeRequest("XXXX")
  
'www.yongfa365.com
  
  
Function
 SafeRequest(ParaValue)   
    ParaValue = 
Trim
(
Request
(ParaValue))   
    
If
 ParaValue = 
""
 
Then
  
        SafeRequest = 
""
  
        
Exit
 
Function
  
    
End
 
If
  
    
'要过滤的字符以","隔开
  
    LockValue = 
"',Select,Update,Delete,insert,Count(,drop table,truncate,Asc(,Mid(,char(,xp_cmdshell,exec master,net localgroup administrators,And,net user,Or"
  
    LockValue = 
Split
(LockValue, 
","
)   
    
'判断是否有注入
  
    
For
 i = 0 
To
 
UBound
(LockValue)   
        
If
 
InStr
(
LCase
(ParaValue), 
LCase
(LockValue(i)))>0 
Then
  
            errmsg = 1   
            
Exit
 
For
  
        
End
 
If
  
    
Next
  
    
'注入处理
  
    
If
 errmsg = 1 
Then
  
        
Response
.
Write
 
"<script language=


相关文档:

sql 常用函数

SQL常用字符串函数
一、字符转换函数
1、ASCII()
返回字符表达式最左端字符的ASCII 码值。在ASCII()函数中,纯数字的字符串可不用‘’括起来,但含其它字符的字符串必须用‘’括起来使用,否则会出错。
2、CHAR()
将ASCII 码转换为字符。如果没有输入0 ~ 255 之间 ......

SQL中declare申明变量

在sql语句中添加变量。
declare @local_variable data_type
声明时需要指定变量的类型,
可以使用set和select对变量进行赋值,
在sql语句中就可以使用@local_variable来调用变量
声明中可以提供值,否则声明之后所有变量将初始化为NULL。
例如:declare @id int
       &nb ......

SQL*PLUS中函数

创建函数
CREATE OR REPLACE FUNCTION ntfuc(inp IN NUMBER)
RETURN NUMBER
IS
ntmp NUMBER;
BEGIN
ntmp := inp;
RETURN ntmp;
END ntfuc;
/
执行该函数时
DECLARE
rcn NUMBER;
BEGIN
rcn := ntfunc(1);
END;
/ ......

VC++的ADO连接SQL Server步骤

 1:SQL  Server数据库配置
 
 
 
开启服务器
 
 
托盘显示服务器启动
 
 
 
2:在StaAfx.h 中添加如下代码
#import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no_namespace      rename("EOF","adoEOF")rena ......

Tips on Optimizing SQL Server Clustered Indexes

http://www.sql-server-performance.com/tips/clustered_indexes_p1.aspx
As a rule of thumb, every table should have a clustered index. Generally, but not always, the clustered index should be on a column that monotonically increases--such as an identity column, or some other column where the value is ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号