Determine if File or Folder Exists in VB.NET:   Return to List

' Declarations
Imports System.IO

' Code
Public Function FileExists(ByVal FileFullPath As String) as Boolean
    Dim f As New IO.FileInfo(FileFullPath)
    Return f.Exists' will be true if exists or false if it does not
End Function

Public Function FolderExists(ByVal FolderPath As String) As Boolean
    Dim f As New IO.DirectoryInfo(FolderPath)
    Return f.Exists' will be true if exists or false if it does not
End Function



Note to Webmaster