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

ASP
发送带附件的HTML格式邮件例程
调用winzip命令行对上传的多个文件打包压缩
怎样做自己的二级域名(之一)
怎样做自己的二级域名(之二)
怎样做自己的二级域名(之三)
从新浪提取上海天气的vbs
列出服务器上的打印机
2栏分页显示(附显示的形式[1][2])
2栏分页显示(附显示的形式前页,后页)
购物车范例(购物车页面 )
购物车范例(处理页面)
GB码和BIG5码的互换技术
在ASP中改善动态分页的性能
利用ASP实现对表的分页浏览(上)
利用ASP实现对表的分页浏览(下)
ASP后台快速调用Mysql 数据库
网络寻呼机数据库版发送消息tomessage.asp
网络寻呼机数据库版处理发送消息SubmitMessage.asp
网络寻呼机数据库版显示消息showmessage.asp
网络寻呼机数据库版显示历史消息history.asp

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


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