|
|
ToDo:
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace DeleteCache
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private string dbCash = "C:\\Documents and Settings\\hikazoh\\Local Settings\\Application Data\\IconCache.db";
private string gdiCash = "C:\\Documents and Settings\\hikazoh\\Local Settings\\Application Data\\GDIPFONTCACHEV1.DAT";
private string fusionCash = "C:\\Documents and Settings\\hikazoh\\Local Settings\\Application Data\\fusioncache.dat";
private string tempDir = "C:\\Documents and Settings\\hikazoh\\Local Settings\\Temp";
private string fntCash = "C:\\WINDOWS\\system32\\FNTCACHE.DAT";
private void button1_Click(object sender, EventArgs e)
{
if (File.Exists(this.dbCash))
{
try
{
File.Delete(this.dbCash);
}
catch (Exception exp)
{
MessageBox.Show("IconCache Delete Failre:" + exp.Message);
}
}
if (File.Exists(this.fntCash))
{
try
{
File.Delete(this.fntCash);
}
catch (Exception exp)
{
MessageBox.Show("FontCache Delete Failre:" + exp.Message);
}
}
if (File.Exists(this.gdiCash))
{
try
{
File.Delete(this.gdiCash);
}
catch (Exception exp)
{
MessageBox.Show("GdiCache Delete Failre:" + exp.Message);
}
}
if (File.Exists(this.fusionCash))
{
try
{
File.Delete(this.fusionCash);
}
catch (Exception exp)
{
MessageBox.Show("FusionCache Delete Failre:" + exp.Message);
}
}
foreach (string dirs in Directory.GetDirectories(this.tempDir))
{
if (Directory.Exists(dirs))
{
try
{
Directory.Delete(dirs);
}
catch (Exception exp)
{
MessageBox.Show("FusionCache Delete Failre:" + exp.Message);
}
}
}
foreach (string files in Directory.GetFiles(this.tempDir))
{
if (File.Exists(files))
{
try
{
File.Delete(files);
}
catch (Exception exp)
{
MessageBox.Show("FusionCache Delete Failre:" + exp.Message);
}
}
}
MessageBox.Show("Delete Complete");
}
}
}