2015年7月19日 星期日

[VB.NET] 檢查檔案是否存在

        Dim FileExists As Boolean = False '確認檔案是否存在

        Dim FilePath = "C:\firm.txt" '檔案路徑

        FileExists = My.Computer.FileSystem.FileExists(FilePath)

        If FileExists = False Then
            '檔案不存在

        Else
            '檔案存在
        End If

沒有留言:

張貼留言