开发者

Displaying files in a directory

I am developing an ASP.NET 3.5 web application and I have a folder in the project which contains a list of documents which could be pdf or any of the MS office 2003 or 2007 supported file formats. I would like to display these files to my users as thumbnails (just like the way windows displays files)开发者_C百科. And when the user clicks on a file it has to prompt them to either save the file or open in the browser itself. How can I achieve this?


You can get the files like this (assuming /Documents)

string path = Server.MapPath(@"/Documents");
string[] files = System.IO.Directory.GetFiles(path);

And nou you only have to write some HTML generating code to display the files the way you want them displayed.


the answer at the following question seems to be RIGHT up your alley (ie the answer)

C# get thumbnail from file via windows api

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜