usvpn Posted May 6, 2010 Posted May 6, 2010 (edited) 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: 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? Edited May 6, 2010 by usvpn Quote
Administrators PlausiblyDamp Posted May 6, 2010 Administrators Posted May 6, 2010 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). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
usvpn Posted May 6, 2010 Author Posted May 6, 2010 So how do you recommend me to just check for root folder? Thank you Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.