Solved

Make a my own ie cache direcory?

Posted on 1998-09-07
4
593 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 111
has22 challenge 11 104
noX challenge 17 126
wordcount challenge 11 129
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

790 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