c# - http url for local files asp.net -
i have treeview
folder under application folder. provide links files in folder. folder might have sub folders , on. how can provide http urls in links.
when physical location of file instead of http url.
path.combine(file.directoryname, file.name)
thanks.
first root of application.
var root = server.mappath("~");
now, need, iterate on files/directories. can combine paths so:
foreach (var file in system.io.directory .getfiles(system.io.path.combine(root, "images"))) { // give relative url of each file. var fileurl = resolveurl(file.replace(root, string.empty).replace("\\", "/")); }
Comments
Post a Comment