Hi all,
I have a TreeView to List contents of a directory. The directory/folder locates on the same server the website is hosted. It is working very well.
I'm trying to list the contents of a directory from external URL.
I have tried many ways and all gives error
URI formats are not supported
which makes sense.
I want to know what is the best way to list contents of URL folder
if possible. If not possible is there an alternative solution?
I'm using asp.net webforms.
Thanks in advance
Samira
What I have tried:
My code to browse folder on the webserver:
DirectoryInfo rootInfo = new DirectoryInfo(@"\\10.0.0.8\d$\f1\webApp\apps");
int directoryCount = rootInfo.GetDirectories().Length;
Docs_treeView.Nodes.Clear();
if (directoryCount > 0)
{
this.PopulateTreeView_WithDirectories(rootInfo, Docs_treeView, null);
}
else
{
this.PopulateTreeView_WithFiles(rootInfo, Docs_treeView, null);
}
Trying to replace
DirectoryInfo rootInfo = new DirectoryInfo(@"\\10.0.0.8\d$\f1\webApp\apps");
with
DirectoryInfo rootInfo = new DirectoryInfo(@"https://abc/f1/webApp/apps");