Solved

Internet explorer cached files

Posted on 2001-06-14
4
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 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