Last post Apr 22, 2008 10:08 PM by Nai-Dong Jin - MSFT
Apr 17, 2008 02:21 PM|Tealc|LINK
One of my web projects has permission to hot link images from a web site. The external site is just for hot linking. My problem is, the image might not exist. I do not have a list of items and their file names. I do know the syntax to the file name though.
Is there a way vb.net can try to load the remote image and based on the length do different things.
Thanks for any input.
Apr 17, 2008 02:49 PM|HostingASPNet|LINK
I think that it will be too slowly to check each time every image. My advice is to think about another solution, maybe to run some script and to scan all images first, and after that to implement their list into your application.
Apr 17, 2008 03:01 PM|Tealc|LINK
Thats kinda what I am thinking. I just don't know how to scan for the images.
Apr 22, 2008 01:53 AM|Nai-Dong Jin - MSFT|LINK
We should separate the issue into two parts. First, you mentioned that you want to access the image folder on the remote machine, right?
Actually, you have no permission to achieve that in your code, since you don’t have the permission to attach the file system on remote machine.
What I suggest is, you can create a web service on the remote machine, and inside the web method, use DirectoryInfo class to get the files information. So in this
way, you can consume the web service in your current project.
Apr 22, 2008 09:57 AM|Tealc|LINK
Would it be possible to request the image via html request, and if the response is a 404 then I know the image doesn't exist?
Apr 22, 2008 10:08 PM|Nai-Dong Jin - MSFT|LINK
Would it be possible to request the image via html request, and if the response is a 404 then I know the image doesn't exist
How do you know the name of each image file, and how do you know the number of images exsited under the specific folder? You do can make an httprequest to the image resource, but you have to know the image url first. The key point in your case is to make the travelsal
of the folder.