Retrieving and Displaying File Icons within an ASP.NET C# Web Application
Posted on 2009-02-16
I am currently playing around with file management within web applications using ASP.NET 3.5. I have been searching on-line and I found a few people asking this same question, some threads were never solved and others were solved but I don't currently have the knowledge to fully understand the solution.
What I want to do (probably obvious from the title) is show file icons next to a list of files that are in a given directory. I've got the list of files, that's all easy-peasy, but I don't even know where to start with getting the icons.
I know I could just point at an image determined by the MIME type or file extension, but it's not perfect.
I have seen examples of the SHGetFileInfo function on a few sites, including MSDN and the Microsoft Support site, but nothing within a web application. Is there a way of using this, or is this for windows form applications only?
This is probably a bit out of my depth at the moment, but I am pretty persistent when I don't know how to do something so anyone's help would be greatly appreciated. Also, (if you don't mind) if you have a solution, could you break it down and explain what's happening? I hate to cut and paste code without knowing exactly what's going on!