• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

How to check for the existence of *.tif files in a given directory?

I have to execcute a section of code which demands for the checking of the existence of *.tif files in a directory.

How can I do that?

Thanks
0
Reeds
Asked:
Reeds
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Something like...

        Dim path As String = "c:\"
        Dim di As New System.IO.DirectoryInfo(path)
        If di.Exists Then
            If di.GetFiles("*.tif").Length > 0 Then
                ' .tif files present
            Else
                ' NO .tif files present
            End If
        Else
            ' path does not exist...
        End If
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now