asp.net 上传

          if (FileUpload1.HasFile) 
        {
            string filenames = FileUpload1.PostedFile.FileName;
            string server_path = "images/";
            string ab_path = Server.MapPath(server_path);

            if (!Directory.Exists(ab_path)) 
            {
                Directory.CreateDirectory(ab_path);
            }

            if (File.Exists(ab_path + filenames)) 
            {
                
            }

            FileUpload1.SaveAs(ab_path + filenames);
        }

  

posted @ 2016-10-19 12:29  尘梦  阅读(118)  评论(0编辑  收藏  举报