设为首页 加入收藏 网站搜索 繁體中文 中国建站网 — 站长资源分享平台

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

来源:网络收集 作者:佚名 时间:2007-04-25 18:22:06
//主要方法
        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
            {
                this.txtResult.Visible = true ;
                this.txtResult.ReadOnly = true ;
                this.barStatus.Text = "正在连结主机…" ;

                string strRequestFile ;

                switch (this.cboMethod.SelectedIndex)
                {
                    case 0:          //直接读取

[1] [2] [3] [4] [5] [6] [7] [8] [9]  下一页

Tags:

  • 好的评价 如果您觉得好,就请您
      0%(0)
  • 差的评价 如果您觉得差,就请您
      0%(0)
  • 相关文章
    广告赞助

    文章随便看看 设计素材 建站学院 网页模板 视频教程

    网友评论

    共有 0 位网友发表了评论,得分 0 分,平均 0 分    查看完整评论

    用户名: 查看更多评论

    分 值:100分 85分 70分 55分 40分 25分 10分 1分

    内 容:

             通知管理员 验证码: