asp.net - How to give resolution for looking server folders? -
in web application users need chose folder special file. don't see paths on server. how can open server folders viewing? on local machine directories fine:
on server this:
call treeadirectory valid server path , have tree rendered :)
private void treeadirectory(treeview treeview, string pathtolist) { treeview.nodes.clear(); var rootinfo = new directoryinfo(pathtolist); var node = createdirnodes(rootinfo); treeview.nodes.add(node); } private static treenode createdirnodes(directoryinfo directoryinfo) { var directorynode = new treenode(directoryinfo.name); var dirs = directoryinfo.getdirectories() foreach (var directory in dirs) { directorynode.nodes.add(createdirectorynode(directory)); } //only if need show files var files = directoryinfo.getfiles() foreach (var file in files ) { directorynode.nodes.add(new treenode(file.name)); } return directorynode;
}
Comments
Post a Comment