Return to Snippet

Revision: 64127
at July 7, 2013 09:30 by nimblebits


Initial Code
Private Function DirectoryExists(ByVal sPath As String) As Boolean

        Try
            If System.IO.Directory.GetDirectories(sPath).Length > 0 Then
                Return True
            End If
        Catch ex As Exception
            Return False
        End Try

        Return False

    End Function

Initial URL

                                

Initial Description
I came across a permission issue when using the standard Directory.Exists()  method, so I came up with another way to check if a Directory exists avoiding those permission issues. This works very well. It can be converted to C'#.

Initial Title
Check Folder Directory Exists Using VB.NET

Initial Tags
directory

Initial Language
VB.NET