/ Published in: VB.NET
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'#.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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