[SQL注入检查工具]编写代码(一) --读取网页信息类

这几天接了个私活,也用到的读取网页的信息,就构造了下面两个类,这个两个类也可以用于SQL注入检查工具这个项目里,所以放这里也刚刚好,注释的我都写了,可是用法我暂时不写了,以后用到就明白了

1、构造了一个web地址类,

2、构造了一个得到页面数据和图片的类

/// <summary>
    
/// 页面连接信息类
    
/// </summary>

     public    class  CWebUrlInfo
    
{
       
        
private string _WebUrl = "";//地址
        /// <summary>
        
/// 地址,包含GET连接数据
        
/// </summary>

        public string WebUrl
        
{
            
get return _WebUrl; }
            
set { _WebUrl = value; }
        }


        
private string _Accept = "*/*"//访问类型,默认*/*
        /// <summary>
        
/// 访问类型,默认*/*
        
/// </summary>

        public string Accept
        
{
            
get return _Accept; }
            
set { _Accept = value; }
        }


        
private string _RefererUrl = "";//引用地址
        /// <summary>
        
/// 引用地址
        
/// </summary>

        public string RefererUrl
        
{
            
get return _RefererUrl; }
            
set { _RefererUrl = value; }
        }


        
private string _ContentType = "application/x-www-form-urlencoded";//文件种类
        /// <summary>
        
/// 文件种类
        
/// </summary>

        public string ContentType
        
{
            
get return _ContentType; }
            
set { _ContentType = value; }
        }


        
private string _UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)"//客户端信息,默认IE6
        /// <summary>
        
/// 客户端信息,默认IE6
        
/// </summary>

        public string UserAgent
        
{
            
get return _UserAgent; }
            
set { _UserAgent = value; }
        }


        
private bool _KeepAlive = true//是否保持连接状态
        /// <summary>
        
/// 是否保持连接状态
        
/// </summary>

        public bool KeepAlive
        
{
            
get return _KeepAlive; }
            
set { _KeepAlive = value; }
        }


        
private CookieContainer _CookieContainer = new CookieContainer();   //cookie数据
        /// <summary>
        
/// cookie数据
        
/// </summary>

        public CookieContainer CookieContainer
        
{
            
get return _CookieContainer; }
            
set { _CookieContainer = value; }
        }


        
private bool _AllowAutoRedirec = false//是否自动跳转
        /// <summary>
        
/// 是否自动跳转
        
/// </summary>

        public bool AllowAutoRedirec
        
{
            
get return _AllowAutoRedirec; }
            
set { _AllowAutoRedirec = value; }
        }


      
    }

 

/// <summary>
    
/// 页面连接信息类
    
/// </summary>

     public    class  CWebUrlInfo
    
{
       
        
private string _WebUrl = "";//地址
        /// <summary>
        
/// 地址,包含GET连接数据
        
/// </summary>

        public string WebUrl
        
{
            
get return _WebUrl; }
            
set { _WebUrl = value; }
        }


        
private string _Accept = "*/*"//访问类型,默认*/*
        /// <summary>
        
/// 访问类型,默认*/*
        
/// </summary>

        public string Accept
        
{
            
get return _Accept; }
            
set { _Accept = value; }
        }


        
private string _RefererUrl = "";//引用地址
        /// <summary>
        
/// 引用地址
        
/// </summary>

        public string RefererUrl
        
{
            
get return _RefererUrl; }
            
set { _RefererUrl = value; }
        }


        
private string _ContentType = "application/x-www-form-urlencoded";//文件种类
        /// <summary>
        
/// 文件种类
        
/// </summary>

        public string ContentType
        
{
            
get return _ContentType; }
            
set { _ContentType = value; }
        }


        
private string _UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)"//客户端信息,默认IE6
        /// <summary>
        
/// 客户端信息,默认IE6
        
/// </summary>

        public string UserAgent
        
{
            
get return _UserAgent; }
            
set { _UserAgent = value; }
        }


        
private bool _KeepAlive = true//是否保持连接状态
        /// <summary>
        
/// 是否保持连接状态
        
/// </summary>

        public bool KeepAlive
        
{
            
get return _KeepAlive; }
            
set { _KeepAlive = value; }
        }


        
private CookieContainer _CookieContainer = new CookieContainer();   //cookie数据
        /// <summary>
        
/// cookie数据
        
/// </summary>

        public CookieContainer CookieContainer
        
{
            
get return _CookieContainer; }
            
set { _CookieContainer = value; }
        }


        
private bool _AllowAutoRedirec = false//是否自动跳转
        /// <summary>
        
/// 是否自动跳转
        
/// </summary>

        public bool AllowAutoRedirec
        
{
            
get return _AllowAutoRedirec; }
            
set { _AllowAutoRedirec = value; }
        }


      
    }
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值