开发者

load images from a folder

开发者 https://www.devze.com 2023-02-07 01:46 出处:网络
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 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

精彩评论

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