How to clear temporary internet foder by using C# in winforms?

Here is the sample code for clearing temporary internet foder by using C# in winforms.

private void btnClear_Click(object sender, EventArgs e)
{
ClearAll(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));
MessageBox.Show("Your temporary files has been cleaned.! ");
}

public void ClearAll(DirectoryInfo dirInfo)
{
foreach (FileInfo fileInfo in dirInfo.GetFiles())
{
try
{
fileInfo.Delete();
}
catch { }
}
foreach (DirectoryInfo subDirectory in dirInfo.GetDirectories())
{
ClearAll(subDirectory);
}
}


...S.VinotkumaR.

4 comments:

Pedro Garcia Millan said...

HOW ABOUT THE DEMONIC REALITY THAT IS CURRENTLY GOING ON IN AMERICA TALK WITH THE SO-CALLED DEMOCRATIC TYRANNY WE ARE ALL LIVING UNDER YET NOBODY DOES ANYTHING TO CHANGE IT:


Jesse was a young tender little negro who ran like there was no tomorrow and ran back to the moloch axis demonniac controlled USA only to see those elected blow up buildings and kill their own citizens in 2001....how sad is that? Bush just kills with impunity & will NEVER see the inside of a court room, but IF you or i just talk-out-loud over the phone about blowing up anything 2 moustachiod officer squad cars would hurriedly come to our door, we'd be arrested and the full weight of the law would be applied!

Now, that seems unfair does it not? Is this the USA good ol' Jesse ran his heart out for? For a TYRANICAL democracy to control the people, spray chemical trails in a grid pattern over every major city to control the weather & blame it on global warming? Dumb the population down with fluoride in the water? Poison every Americans stomach with monsanto soy, sunflower, canola & corn seeds that are genetically modified and have the pesticide already built in to the seed itself? THAT'S POISON YOU IGNORANT PUBLIC who would rather concentrate on NHL, MLB, NBA, NFL and get in debt more & more & more & more with mortgages, loans & credit cards you don't need...WAKE UP MORONS! The moloch axis demoniacs ALREADY have you & OWN you people!

DO SOMETHING TO CHANGE your lot in life BEFORE it's too late & BIG BROTHER is sniffing right up your buttock like a hound dog. Just look at the USA paid negro fella "pretending" to blow up an airplane in Detroit. NOW, the USA has the perfect excuse to control you & be even MORE intrusive in your lives....how "clever" the moloch axis are...THEY create a so-called TERRORIST problem/threat & they pass laws to further control the citizenry. And the citizenry say," Yeah man, who won in the NFL today, was it Dallas?"...MORONS!

The USA populous NEEDS to wake up and vote out of office these demon worshipping politicians that pass laws that DO NOT BENEFIT the people. DON'T take my word for it, just look yourselves & you'll SEE that 99% of ANY law passed goes against the family, to further erode family ties, and people in general! Go ahead & look, just look :)

PLEASE PASS IT ON...thank you!


=============================================================


ONE MORE I CAN NEVER UNDERSTAND.....WHY IF YOU PRAY TO GOD CONTINUOUSLY TO WIPE OFF THE FACE OF THE EARTH ALL OF THE OCCULT (WHICH WOULD MEAN ALL THE MOLOCH WORSHIPPING POLITICIANS IN THE USA LIKE THE BUSH'S, CHENNEY, OBAMA ETC.) THE OCCULT ARE STILL HERE DESTROYING THE FAMILY, CHEMICALLY SPRAYING IN A GRID PATTERN OVER EVERY MAJOR CITY IN THE USA VIA AIRPLANES, ALLOWING MONSANTO GENETICALLY MODIFIED SEEDS TO ENTER OUR FOOD CHAIN TO POISON US (SEEDS CONTAIN A BUILT-IN PESTICIDE).

where is god???????????????????????? IS HE LISTENING????????

carl can said...

This is a good post. This post give truly quality information.I’m definitely going to look into it.Really very useful tips are provided here.thank you so much.Keep up the good works.clarksville defense lawyer

Unknown said...

it works great!!
btw i have a blog and a web directory, would you like to exchange links? let me know at emily.kovacs14@gmail.com

Emily :)

Unknown said...

Thanks for the write up……………..!Keep up!The organization logo and brand punch line are imprinted with an aim to improve the overall brand visibility. Even the color scheme and typographic setting implemented in designing these beer coasters takes into account the brand positioning.

aion accounts