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>

  • 相关阅读:
    SQLite 基本使用
    SQLite 语法
    html5晋级之路-css介绍
    html5晋级之路-web storage
    html5晋级之路-元素语法
    html晋级之路-背景、实体
    ios-晋级之路 CocoaPods的使用
    如何在Mac OS X上安装 Ruby运行环境
    html5晋级之路-学习笔记表单
    html5晋级之路-学习笔记
  • 原文地址:https://www.cnblogs.com/kingboy2008/p/2124745.html
Copyright © 2011-2022 走看看