zoukankan      html  css  js  c++  java
  • 通过HttpModule、httpHandlers防止SQL注入式攻击

    1、通过HttpModule防止SQL注入式攻击,适用于.net1.1程序
    (1)新建类文件SqlHttpModule.cs,具体代码类似如下:



    (2)在web.config文件中做以下配置
       </system.web>
         <httpModules>
               <add name="SqlHttpModule" type="HttpModule.Class.SqlHttpModule, HttpModule" />
         </httpModules>
       </system.web> 

    2、通过httpHandlers防止SQL注入式攻击,适用于.net2.0及以上程序
    (1)新建类文件SqlhttpHandlers.cs,具体代码类似如下:


    (2)在web.config文件中做以下配置
       </system.web>
         <httpHandlers>
            <add verb="*" path="*.aspx" type="httpHandlers.SqlhttpHandlers, httpHandlers"/>
         </httpHandlers>
       </system.web>

  • 相关阅读:
    html中嵌入天气预报
    linux简单命令
    正则表达式基本语法
    jquery表单验证
    yaf函数方法及使用
    php函数
    yaf框架的特点
    mysql数据库
    php连数据库
    xml基础知识
  • 原文地址:https://www.cnblogs.com/kingboy2008/p/2124745.html
Copyright © 2011-2022 走看看