Accessing network drives
-
I'm currently trying to create an OpenDialog that is similar to the Windows Explorer in appearance. (TreeView on the left, ListView on the right) To get the logical drives is pretty simple. I just use the Directory.GetLogicalDrives() method. However, I didn't find anything similar to access network drives, like in the Network-node in the Windows Explorer TreeView. I found a few solutions, that take hundreds of lines of code to get the result, that this one method achieves for the logical drives. Is there no shorter way? If there is one, what is it?
-
I'm currently trying to create an OpenDialog that is similar to the Windows Explorer in appearance. (TreeView on the left, ListView on the right) To get the logical drives is pretty simple. I just use the Directory.GetLogicalDrives() method. However, I didn't find anything similar to access network drives, like in the Network-node in the Windows Explorer TreeView. I found a few solutions, that take hundreds of lines of code to get the result, that this one method achieves for the logical drives. Is there no shorter way? If there is one, what is it?
Is there a reason why you're not using the common OpenFileDialog? Unless there is some technical reason or compelling user scenario for not doing so, I'd suggest using the common Windows dialogs because they help to keep a consistent user interface across applications and therefore breeds familiarity for the user. In addition, if Microsoft decides to revamp the dialogs, your application will automatically inherit the improvements. Plus, it's a lot less work. :-) Anyway, just my humble opinion. I realize that the common dialogs won't work well in every possible situation. -Phil
-
Is there a reason why you're not using the common OpenFileDialog? Unless there is some technical reason or compelling user scenario for not doing so, I'd suggest using the common Windows dialogs because they help to keep a consistent user interface across applications and therefore breeds familiarity for the user. In addition, if Microsoft decides to revamp the dialogs, your application will automatically inherit the improvements. Plus, it's a lot less work. :-) Anyway, just my humble opinion. I realize that the common dialogs won't work well in every possible situation. -Phil
The common OpenFileDialog can't be modified (At least not without some rather complicated hacking.). I just thought it would be a lot nicer to have one dialog instead of using the common dialog and opening a custom dialog upon closing the common one, to ask the user for all the remaining settings. With my custom OpenDialog filtering is a lot more flexible. I can not only filter files by their ending, but also display them in the listView without it.