2017年1月11日 星期三

判斷路徑資料夾是否存在及建立資料夾

VB.NET
判別路徑資料夾是否存在:
 If Not IO.Directory.Exists("Path+資料夾名稱") Then

            '如不存在,建立資料夾
            IO.Directory.CreateDirectory("Path+資料夾名稱")
 End If


判別路徑檔案是否存在:
 System.IO.File.Exists("Path+FileName")