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

ASP
使用ASP和Word进行服务器端拼写检查
文本中首字母全改为大写
检测整数和长整数的函数
谈谈如何在不支持数据库的asp主页上运用ado
在多行文本框中显示读取信息
生成一个不重复的随即数字
网上追捕(很多实用的port)
用javascript隐藏超级链接的真实地址
给浏览器的滚动条加上颜色
asp+中是如何连接数据库ado+的
几个对图形进行动态处理的dhtml代码
域名登记查询(whois)很复杂吗--方法一
域名登记查询(whois)很复杂吗--方法二
用ASP创建多栏选项列表
asp中的一个奇怪的函数
瞒天过海html文件技术一瞥
如何在服务器上保存一定时间的信息
用ASP发 WAP MAIL(=)
创建弹出式“每日提示”窗口
用两行代码在浏览器中实现文件上传

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 85 ::
收藏到网摘: 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
       &