Public Function IsImage(filePath As String) As Boolean Dim oImg As System.Drawing.Image Try oImg = System.Drawing.Image.FromFile(filePath) oImg.Dispose() Return True Catch ex As Exception Return False End Try End Function