开发者

load images from a folder

I want to load images from a folder loca开发者_如何学Goted on my server eg. webimages and its located in my web root. How can i load these images without predefining paths in XML or database?

I mean, if i add some image in the webimages, my code should automatically load the images from this folder. All i need to tell the code is to point to that folder and it should return me all the images in that folder.


You use the MapPath Function to return the underlying folder:

http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx

And use the Directory class to get the contents of the Folder:

http://msdn.microsoft.com/en-us/library/system.io.directory(v=VS.100).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜