Directory Root

usvpn

Freshman
Joined
Apr 19, 2010
Messages
45
Hi,
I have a dynamic path and every time I want to check it and if it is the root of drive warn user, so I am doing this:
Visual Basic:
If MyPath = Directory.GetDirectoryRoot(MyPath) Then
    'Warn user
End if

MyPath is returned from a control like FolderBrowseDialog so I'm sure it cannot be an invalid path...

Is it the best way you think?
 
Last edited:
It might be worth trying to log the actual path that raises the error and see what they are doing, there is a good chance they are selecting non-folder things (shell extensions for cameras and similar).
 
Back
Top