Zi 字媒體
2017-07-25T20:27:27+00:00
C# 檔案是否存在,資料夾是否存在
資料來源:http://toimy.blogspot.tw/2010/03/c_15.html
判斷目錄是否存在
//判斷C槽是否存在
if (Directory.Exists(“C:”))
{
//有
}
//判斷執行檔路徑裡檔案CMD.txt是否存在
if (System.IO.File.Exists(Application.StartupPath + @”\COM.TXT”))
{
//有
}
寫了
5860316篇文章,獲得
23313次喜歡