当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个用c#写的扫描asp源码漏洞的应用程序(续)

ASP
ADO如何提供异动功能?(BIG5)
从数据库中动态选取下拉列表的方法
数 据 库 设 计 经 验 谈
用SQL实现分布式数据复制
NT4的ODBC与SQL7相连,不支持中文?
大部分ADO的错误码对应的含义
ASP+中取代ASP的RS(Remote Scripting)技术的Framework
利用Page.IsPostBack属性保持用户输入的Framework
用VB6读写数据库中的图片
VisualInterDev6.0七种实现分页显示的方法
利用ASP获得图象的实际尺寸的示例
5个实用的ASP网站功能(GIB5)
在ASP中用集合成批操作数据库
用asp管理sql server数据库
用asp处理access数据库
使用速度更快的OLEDB取代ODBC连结
对Query字段进行Encode操作的一点看法
用ASP语言实现对SQL SERVER 数据库的操作
Microsoft SQL Server 7.0 备份及恢复相关问题
Microsoft SQL Server 7.0数据库升级转换问题

ASP 中的 一个用c#写的扫描asp源码漏洞的应用程序(续)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 79 ::
收藏到网摘: n/a

  //主要方法
        protected void btnGo_Click (object sender, System.EventArgs e)
        {

            //解析url
            string strServer = this.txtServer.Text ;
            string strUrl   = this.txtFileName.Text ;
            char [] point = {'.'} ;   //定义分割符为"."
            char[] line = {'/'} ;     //定义分割符为"."
            string [] arrString = strUrl.Split(line) ;

            //求asp文件全名
            string strFileName = arrString[arrString.Length - 1] ;
            //求从根目录下的路径
            string strPath = strUrl.Substring( 0 ,
                             strUrl.Length - strFileName.Length) ;

            //解析文件全名
            arrString = strFileName.Split(point) ;
            //求文件扩展名
            string strLast = arrString[arrString.Length - 1] ;
            //求文件名
            string strFirst = strFileName.Substring( 0 ,
                              strFileName.Length - strLast.Length - 1) ;
            


            //使按钮、输入框等失效
            this.txtServer.ReadOnly = true ;
            this.txtFileName.ReadOnly = true ;
            this.btnClear.Enabled = false ;
            this.btnGo.Enabled = false ;


            if (this.txtServer.Text == "http://" || this.txtFileName.Text == ""
                || this.txtServer.Text.Trim()== "" ||
                this.txtServer.Text.Substring(0,7) != "http://")
            {
                MessageBox.Show("请输入正确的主机名和文件名!") ;
                this.txtServer.Focus() ;
            }
            else
       &