string TASK_ID = "pp_hsiao";
string serverDir = Request.PhysicalApplicationPath + "\\upload\\mapzipfile\\" + TASK_ID;//路徑
///檢查 「檔案」 是否存在
if (File.Exists(serverDir + "\\" + TASK_ID + ".xls"))
{
//如果檔案存在
File.Delete(serverDir + "\\" + TASK_ID + ".xls");//刪除檔案
}
///檢查 「資料夾」 是否在在
if (Directory.Exists(serverDir + "\\" + TASK_ID))
{
//如果檔案存在
Directory.Delete(serverDir + "\\" + TASK_ID);//刪除檔案
}
沒有留言:
張貼留言