Solved

Internet explorer cached files

Posted on 2001-06-14
4
186 Views
Last Modified: 2012-05-04
Hi now im at it again,

I am building my own internal browser and need to add save functionality now since an image already has been downloaded to a chache directory there is no point in downloading it from the net again. There for my broblem.
How to get the corresponding filename from the disk. I am using:

htmlWin.event.srcElement.NameProp to get the image name, now internet explorer sometimes renames the files when chaching it an image called banner1.jpg may actually be named banner1[1].jpg on the disk my first question is: is the 1 inside [] the property: htmlWin.event.srcElement.uniqueNumber? or something else.
Next question is: are there a good way to know where the chache directory is? I now that there is a key in the registry under HKEY_Local_Machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths called Directory but I have noticed that internet exlorer sometimes creates subdirectories and puts the file in there (and ofcourse there are the cache1, cache2, cache3 ... directories)

regards
/Claes


Or mayby there is a way to catch a ondownload event for every object on the html page and steer my browser to cache its files in a different directory? I am using
Webbrowser, htmlDoc and htmlWindow2 components..

Or mayby I could convert the htmlImg to a real Image and save it to disk is this possible?
how to set Image1 = htmlImg?
0
Comment
Question by:clylv
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:andyclap
ID: 6190042
Just a quick comment - if you're using the web browser control, it will take care of cacheing for you. If an image is available in the cache, and you're not doing a full refresh, it should pick it up from there rather than doing a GET from the server.
0
 

Author Comment

by:clylv
ID: 6190074
andyclap I now this but MY program needs to get a hold of it (the image) now how I can extract it from the webbrowser control into an Image control?
0
 
LVL 6

Accepted Solution

by:
andyclap earned 50 total points
ID: 6190194
Sorry, I misunderstood the question a bit.
There's some sample code for reading the internet cache at
http://www.vbusers.com/code/codeget.asp?ThreadID=209&PostID=1&NumReplies=0

It should give you some pointers as to how to use wininet.dll's cache functions (which are a bit of a pain as they're not very VB friendly).


0
 

Author Comment

by:clylv
ID: 6190386
andyclap: it is as u say "not very VB friendly" but never the less IT WORKS perfectly

thanx
/Claes
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question