当上传同名文件的话,就把原有的给覆盖了。。。
代码有问题
修改,\admin\Pages\Add_entry.aspx

   private void Upload(string virtualFolder, FileUpload control, string fileName)
    {
        string folder = Server.MapPath(virtualFolder);
        if (!Directory.Exists(folder))
            Directory.CreateDirectory(folder);
        int c = 0;
        string savapath = folder + fileName;
        while (File.Exists(savapath))
        {
            c++;
            savapath = folder +c+ fileName;
        }
      
            control.PostedFile.SaveAs(savapath);
       
    }

相关文章:

  • 2021-08-06
  • 2022-01-27
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-01-09
  • 2021-08-18
  • 2022-12-23
  • 2021-04-26
  • 2022-01-07
  • 2021-07-19
相关资源
相似解决方案