一、根据虚拟路径获取文件物理路径:

       string savePath = Server.MapPath("~/Uploads/RemoteDatum/");

二、判断文件夹是否存在

      if (!System.IO.Directory.Exists(@"E:\Files")) 
      { 
            System.IO.Directory.CreateDirectory(@"E:\Files");//不存在就创建文件夹

       } 

三、判断文件是否存在

     if(File.Exists(@"E:\Files\test.txt")) 
    { 
        //存在 
    } 
    else 
   { 
    //不存在 

    }  

相关文章:

  • 2021-10-23
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-12-20
相关资源
相似解决方案