473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Accessing Windows File Icons in ASP.NET

I'm wondering if it's possible to access and use windows file icons in
a webpage using, for example, the shell method SHGetFileInfo. I'm
writing a small asp.net app to browse directories on a server and
would like the icons to display as a regular windows directory
browser. Is this even possible?

The following link provides a class to do it in a VB app, but it uses
System.Drawing to display the icon. For the puposes of a webpage, I
assume I need a reference to a jpg or gif.

http://www.vbaccelerator.com/home/NE...ll/article.asp

Thanks in advance for any suggestions.

Nick
Nov 18 '05 #1
1 1723
Jos
nick wrote:
I'm wondering if it's possible to access and use windows file icons in
a webpage using, for example, the shell method SHGetFileInfo. I'm
writing a small asp.net app to browse directories on a server and
would like the icons to display as a regular windows directory
browser. Is this even possible?

The following link provides a class to do it in a VB app, but it uses
System.Drawing to display the icon. For the puposes of a webpage, I
assume I need a reference to a jpg or gif.


True.

Create a separate aspx-file for the image like this:

<%@ Page Language="VB" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Drawing.Imaging" %>
<%@ import Namespace="System.Drawing.Drawing2D" %>
<script runat="server">
Sub Page_Init( sender As Object, e As EventArgs)
Response.ContentType = "image/gif"
Dim objBitmap As Bitmap= new Bitmap(16,16)
Dim filename As String = Request.QueryString("filename")
... bring your icon into the bitmap here ...
' Save the image to a file
objBitmap.Save(Response.OutputStream, ImageFormat.Gif)
End Sub
</script>

Display the result in your page like this:
<img src="imagefile.aspx?filename=whatever">

The main problem (as I have found) is that the .NET framework
doesn't support transparent GIF's.
Which is exactly what you would need for icons.

I wrote a similar project as you did, and finally, I gave up and I just
used a single static GIF image for the folders, and I didn't bother
about other file icons.

--

Jos
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jessard | last post by:
Hello all, I have a VB6 .RES file containing some images and icons. I am writing a VB.NET windows application and would like to access the images in the aforementioned .RES file. How would I go...
4
by: What-a-Tool | last post by:
Is possible to use the windows image list for icon display in my treeview control? Would appreciate it you could point me towards a code sample or Key phrase to use in a google search. Thanks...
3
by: Quan Nguyen | last post by:
I'm trying to look for the icons/images (New/Open/Save, Copy/Cut/Paste...) typically used in toolbars in Windows applications, such as MS Word. I'd appreciate if anyone can point me to a webpage...
4
by: redneon | last post by:
I've written a simple application which connects to an FTP server and recursively lists the contents of the directories in this server in a ListBox. What I'm wanting to do is change the ListBox and...
10
by: - HAL9000 | last post by:
I am deploying my solution using the Setup Project template to generate a windows installer (msi file). 1) The "Primary output" option in the wizard has generated a dozen or so ..dll files that...
3
by: Istvan Albert | last post by:
I've been using the new python icons for windows for about two weeks now and I must say they've turned out to be far less functional than I thought. From purely visual standpoint the new icons look...
1
by: Jon Slaughter | last post by:
I'm trying to create a windows explorer like app and the problem I'm having is getting the proper icon for the folders and items. In windows explorer there are many different icons and most seem...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Overview NOTE- This complete article on "Windows Autorun FAQs" applies theoretically to all Windows NT-based OSes till Windows Vista (and probably Vista's successors too)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.