Solved

Make a my own ie cache direcory?

Posted on 1998-09-07
4
587 Views
Last Modified: 2013-11-20
I am using IE web control in my application to access some local HTML or remote URL.

When I browse to a certain Local *.html page or remote URL, the file is cached with all its *.gif, *.ocx,...etc in ie catche directories.

I want to do the followings:
1. Get a list (name and physical location on the local HDD)of all these cached files for (only) the currently browsed page.
2. Copy these files to my own cache directory.

Any idea how can I do that with or without webbrowser control. Is there a sample code or class for doing that?

Thanks for the help.

0
Comment
Question by:kawa
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1321851
WinInet API has the following cache functions.

The following persistent URL cache functions allow an application to access and manipulate information stored in the cache. Function  Description  
CommitUrlCacheEntry  Caches data in the specified file in the cache storage and associates it with the given URL.  
CreateUrlCacheEntry  Allocates the requested cache storage and creates a local file name for saving the cache entry corresponding to the source name.  
CreateUrlCacheGroup  Generates a cache group identification.  
DeleteUrlCacheEntry  Removes the file associated with the source name from the cache, if the file exists.  
DeleteUrlCacheGroup  Releases a GROUPID and any associated state in the cache index file.  
FindCloseUrlCache  Closes the specified enumeration handle.  
FindFirstUrlCacheEntry  Begins the enumeration of the cache.  
FindFirstUrlCacheEntryEx  Begins a filtered enumeration of the cache.  
FindNextUrlCacheEntry  Retrieves the next entry in the cache.  
FindNextUrlCacheEntryEx  Retrieves the next entry in a filtered cache enumeration.  
GetUrlCacheEntryInfo  Retrieves information about a cache entry.  
GetUrlCacheEntryInfoEx  Searches for the URL after translating any cached redirections that would be applied in offline mode by HttpSendRequest.  
ReadUrlCacheEntryStream  Reads the cached data from a stream that has been opened using RetrieveUrlCacheEntryStream.  
RetrieveUrlCacheEntryFile  Retrieves a cache entry from the cache in the form of a file.  
RetrieveUrlCacheEntryStream  Provides the most efficient and implementation-independent way of accessing the cache data.  
SetUrlCacheEntryGroup  Adds or removes entries from a cache group.  
SetUrlCacheEntryInfo  Sets the specified members of the INTERNET_CACHE_ENTRY_INFO structure.  
UnlockUrlCacheEntryFile  Unlocks the cache entry that was locked while the file was retrieved for use from the cache.  
UnlockUrlCacheEntryStream  Closes the stream that has been retrieved using RetrieveUrlCacheEntryStream.  

You can get the source URLs and local filenames in the cache by using these functions.
0
 

Author Comment

by:kawa
ID: 1321852
Thanks. That seems to be what I am looking for.

However it is a big subject for my humble level. Is there any pointer to an example that is using these functions?
The documentations on VC++ are not clear for me.

0
 
LVL 23

Expert Comment

by:chensu
ID: 1321853
Unfortunately, there is no sample. These functions are quite straightforward. It is not difficult to use. I agree that the documentations are not clear. You may have to do some experiments.

Good luck!
0
 

Author Comment

by:kawa
ID: 1321854
Thanks
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Define unique primary key 9 81
viewing source code from eclipse 13 74
Hibernate methods 2 58
modThree challenge 4 64
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

746 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

13 Experts available now in Live!

Get 1:1 Help Now