Function IsImageFile(ByVal filePath As String) As Boolean Dim extensions() As String = New String() {".bmp", ".jpg", ".jpeg", ".gif", _ ".tif", ".tiff", ".png", ".tga", ".emf", ".wmf", ".bid"} Return (Array.IndexOf(extensions, New System.IO.FileInfo(filePath) _ .Extension) > -1) End Function |