Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

Delete All Temporary Internet Files Of IE

Delete all the temporary files from Internet Explorer's cache folder using basic methods available in the System.IO namespace.

On Friday, October 17th 2008 at 09:31 PM
By Andrew Pociu (View Profile)
****-   (Rated 3.1 with 7 votes)
Contextual Ads
More C# Resources
Advertisement
  1. using System.IO;
  2.  
  3. public static void Main()
  4. {
  5.    ClearFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache))); // Execute ClearFolder() on the IE's cache folder
  6. }
  7.  
  8. void ClearFolder(DirectoryInfo diPath)
  9. {
  10.    foreach (FileInfo fiCurrFile in diPath.GetFiles())
  11.    {
  12.       fiCurrFile.Delete();
  13.    }
  14.    foreach (DirectoryInfo diSubFolder in diPath.GetDirectories())
  15.    {
  16.       ClearFolder(diSubFolder); // Call recursively for all subfolders
  17.    }
  18. }
  19.  
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this code snippet
Comment Current Comments
by somekind on Sunday, October 19th 2008 at 05:30 PM

Why it does not work?

by irtu on Thursday, November 20th 2008 at 10:49 AM

neat

by onetime on Monday, December 8th 2008 at 12:14 AM

good one

by a on Monday, December 8th 2008 at 12:14 AM

xyx

by kundan on Saturday, March 14th 2009 at 12:25 PM

what about index.dat. it is not deleting...

by kundan on Saturday, March 14th 2009 at 12:29 PM

what about index.dat. it is not deleting...

by aaa on Saturday, August 8th 2009 at 09:13 PM

did not work for me. only returned one file.

by jj on Tuesday, August 11th 2009 at 08:49 AM

ah, the trick is the directories too. when you look at the Temporary Internet Files in windows explorer, it shows everything as if it was all there. its actually scattered through out a number of folder.s

by Vishal Rastogi on Tuesday, September 22nd 2009 at 03:56 AM

Its unable to delete index.dat...


Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs C# Job Search
My skills include:

Enter a City:

Select a State:


Advanced Search >>
Sponsors
Discover Geekpedia

Other Resources