Cannot Enumerate IE Temporary Files Folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

VS 2003, XP SP2

------------------------------------------------------------
DirectoryInfo temporary = new
DirectoryInfo( Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));
FileInfo [] files = temporary.GetFiles();
foreach(FileInfo fi in files)
{
Console.WriteLine(fi.FullName);
}

-------------------------------------------------------

This is the only output.

C:\Documents and Settings\test\Local Settings\Temporary Internet
Files\Temporary Internet Files\desktop.ini
 
VS 2003, XP SP2

------------------------------------------------------------
DirectoryInfo temporary = new
DirectoryInfo( Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));
FileInfo [] files = temporary.GetFiles();
foreach(FileInfo fi in files)
{
Console.WriteLine(fi.FullName);
}

-------------------------------------------------------

This is the only output.

C:\Documents and Settings\test\Local Settings\Temporary Internet
Files\Temporary Internet Files\desktop.ini

What other files? Desktop.ini is the only file in the Temporary Internet
Files folder. Everything else in there is a sub-folder. If you want to
see everything you'll need to get the folders and then traverse into each
one of them getting the files. Most of the Internet Explorer cache is in
sub-folders under the Content.IE5 (if using IE5 or IE6) folder under
Temporary Internet Files.
 
see the snapshot here at ImageShack:

http://img495.imageshack.us/img495/7581/untitled5mo.jpg

Just to add, I am using IE7 beta 1.

Moreover, I don't see any ContentIE folders etc.
--
---------------------
Thanks
Rajiv Das


Tom Porterfield said:
VS 2003, XP SP2

------------------------------------------------------------
DirectoryInfo temporary = new
DirectoryInfo( Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));
FileInfo [] files = temporary.GetFiles();
foreach(FileInfo fi in files)
{
Console.WriteLine(fi.FullName);
}

-------------------------------------------------------

This is the only output.

C:\Documents and Settings\test\Local Settings\Temporary Internet
Files\Temporary Internet Files\desktop.ini

What other files? Desktop.ini is the only file in the Temporary Internet
Files folder. Everything else in there is a sub-folder. If you want to
see everything you'll need to get the folders and then traverse into each
one of them getting the files. Most of the Internet Explorer cache is in
sub-folders under the Content.IE5 (if using IE5 or IE6) folder under
Temporary Internet Files.
 
see the snapshot here at ImageShack:

http://img495.imageshack.us/img495/7581/untitled5mo.jpg

Just to add, I am using IE7 beta 1.

Moreover, I don't see any ContentIE folders etc.

Calling GetFiles isn't going to get you folders. You'll need to call
GetDirectories to get that folder. What you see when browsing the
Temporary Internet Files folder through Windows Explorer is not the actual
contents as they are written to the file system. Delete the desktop.ini
file from Temporary Internet Files (either at the command prompt or in your
C# program) and then open the folder in Explorer to see what I mean. Make
sure you don't run Internet Explorer before browsing the folder in Windows
Explorer as IE will put the desktop.ini file (which tells Windows Explorer
to view the folder using a special filter rather than simply showing the
contents as they are stored in the file system) back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top