close

using System.IO;


string NewFilePath = (System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Output\\" + CoIdFileName + YrId + SsId + "\\").Replace("/", "\\");
string[] files = Directory.GetFiles(NewFilePath, "*.xls");//找出目錄底下檔案

//逐筆刪除
 foreach (string file in files)
{
 File.Delete(file);
}

 


//刪除空資料夾
 Directory.Delete(路徑);

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 鴨鴨仔 的頭像
    鴨鴨仔

    DUCK,Fearless!

    鴨鴨仔 發表在 痞客邦 留言(0) 人氣()