黑色假期红色婚礼电影1:C# 清理IE缓存文件实例代码-程序开发-红黑联盟
来源:百度文库 编辑:九乡新闻网 时间:2024/04/25 09:41:25
C# 清理IE缓存文件实例代码
文章录入:王子 责任编辑:7747.Net 25
【字体:小大】
C# 清理IE缓存文件实例代码如下:
using System; using System.IO; using System.Windows.Forms; using System.Text.RegularExpressions; namespace WinFormTemp { public partial class FormTemp : Form { public FormTemp() { InitializeComponent(); this.HelpButton = true; this.MaximizeBox = false; this.MinimizeBox = false; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。 this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。 this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。 } protected override void OnLoad(EventArgs e) { base.OnLoad(e); DirectoryInfo dir = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)); foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories)) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; try { info.Delete(); } catch { continue; } } System.Diagnostics.Process.Start(dir.FullName); } protected override void OnHelpButtonClicked(System.ComponentModel.CancelEventArgs e) { base.OnHelpButtonClicked(e); e.Cancel = true; FileInfo info = new FileInfo("Clear.bat"); if (info.Exists) info.Attributes = FileAttributes.Normal; using (StreamWriter sw = info.CreateText()) { sw.WriteLine("@echo off"); sw.Write(@"del /f /s /q ""{0}""", Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)); } System.Diagnostics.Process.Start(info.DirectoryName); } } }
文章录入:王子 责任编辑:7747.Net 25
【字体:小大】
C# 清理IE缓存文件实例代码如下:
using System; using System.IO; using System.Windows.Forms; using System.Text.RegularExpressions; namespace WinFormTemp { public partial class FormTemp : Form { public FormTemp() { InitializeComponent(); this.HelpButton = true; this.MaximizeBox = false; this.MinimizeBox = false; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。 this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。 this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。 } protected override void OnLoad(EventArgs e) { base.OnLoad(e); DirectoryInfo dir = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)); foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories)) { if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。 continue; try { info.Delete(); } catch { continue; } } System.Diagnostics.Process.Start(dir.FullName); } protected override void OnHelpButtonClicked(System.ComponentModel.CancelEventArgs e) { base.OnHelpButtonClicked(e); e.Cancel = true; FileInfo info = new FileInfo("Clear.bat"); if (info.Exists) info.Attributes = FileAttributes.Normal; using (StreamWriter sw = info.CreateText()) { sw.WriteLine("@echo off"); sw.Write(@"del /f /s /q ""{0}""", Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)); } System.Diagnostics.Process.Start(info.DirectoryName); } } }
C# 清理IE缓存文件实例代码-程序开发-红黑联盟
C# 清理Cookies文件实例代码-程序开发-红黑联盟
C# Socket多线程编程实例-程序开发-红黑联盟
C#反射的理解-程序开发-红黑联盟
使用C#多线程设计的电脑摇奖程序-程序开发-红黑联盟
用设计模式固化你的C#程序(2)-程序开发-红黑联盟
用设计模式固化你的C#程序(3)-程序开发-红黑联盟
提高网站速度:ASP.NET缓存详解-程序开发-红黑联盟
c#泛型和反射的设计应用-程序开发-红黑联盟
多线程下载(FtpWebRequest)-程序开发-红黑联盟
Asp.net常用的操作函数-程序开发-红黑联盟
Asp.net网站性能优化二则-程序开发-红黑联盟
10个常用方法有效优化ASP.NET的性能-程序开发-红黑联盟
介绍asp.net正则表达式的组集合-程序开发-红黑联盟
Asp.Nne 编程常用的二十六个函数详解-程序开发-红黑联盟
掌握Asp.Net编程语言的九大步骤-程序开发-红黑联盟
到底是什么反射,泛型,委托,泛型-程序开发-红黑联盟
浅析C#中的文件操作实例
如何删除和清理电脑中缓存和无用文件?
设置IE缓存大小
ASP程序中输出Excel文件实例一则
C#程序调用非托管C++ DLL文件的方法 - Chase的技术博客 - 博客园
C#程序书写规范
清理IE地址栏问题