This is a migrated thread and some comments may be shown as answers.

Browse all shared folders on a specified network server

1 Answer 259 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 24 Aug 2010, 11:07 PM
Hello,

I'm using Telerik FileExplorer control with a custom provider from this KB article that allows to browse a shared folder in my local network.

It works fine when I specify a shared folder path like "\\myServer\mySharedFolder", however it does not work with a network path that has just a server name in it (e.g. "\\myServer").

I would like to be able to provide a server name and see the list of all shared folders on such server and then browse these folders.
Is it possible to do?

Thanks,
Michael

1 Answer, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 26 Aug 2010, 03:06 PM
OK, I think I've solved this.

I've created my own GetDirectories method that can handle both "//server/share" and "//server" paths. It uses regular expressions to figure out what kind of path is given and then either calls standard System.IO.Directory.GetDirectories() method for //server/share like paths or uses the code from this CodeProject article to enumerate shared folders on the server.

Then I've changed all the calls to System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() methods in the CustomProvider code and everything started to work fine for me. 

I have to mention, that we only intend to use FileExplorer to browse files on remote server, not sure how well my solution will work for folders moving/deleting scenarios.

Tags
FileExplorer
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Share this question
or