全速加载中

asp.net学习笔记·文件上传

简单上传

未做安全保护

  if (FileUpload1.HasFile)
            {
                string strUpLoadPath = Server.MapPath("~/Images/");

                TextBox1.Text = strUpLoadPath + FileUpload1.FileName;
                FileUpload1.SaveAs(strUpLoadPath + FileUpload1.FileName);
                
                //Response.Write(@" <script type = 'text/javascript'>alert('上传成功'); </script>");
                labFileUpdateTrue.Visible = true;
            }
            else
            {
                labFileUpdateFalse.Visible = true;
            }
        }
    }

  

posted @ 2012-12-27 22:14  许鸿飞  阅读(164)  评论(0编辑  收藏  举报