Solved

Internet explorer cached files

Posted on 2001-06-14
4
178 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now