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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -