這裡蒐索程式師資訊,查找有用的技術資料
當前位置:首頁 » 網頁前端 » webcleaner
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

webcleaner

發布時間: 2022-12-12 01:13:45

A. 目前什麼殺毒軟體最有效果

精確的沒有.......
一般用的人比較多的就是卡巴,效果也的確不錯
隨後就是瑞星,麥咖啡,金山,賽門鐵克,江民,等等
但是,目前厲害的,還有一些小的,比如,超級巡警,AVG殺毒都很厲害
最後還要提一款,微點主動防禦軟體
我在用,特點什麼的就不說了,網上都有,我想說的是,真的很不錯
建議你試試!

B. c# webbrowser 清除cookie和緩存

由於緩存文件是特殊的文件,以及WebBrowser與IE版本有關
因此刪除緩存絕對不可能用一些IO函數就總可以解決的
因此我的這些函數在IO操作的基礎上,又針對環境進行相應的清理。
static class WebCleaner
{
/*
* 7 個靜態函數
* 私有函數
* private bool FileDelete() : 刪除文件
* private void FolderClear() : 清除文件夾內的所有文件
* private void RunCmd() : 運行內部命令
*
* 公有函數
* public void CleanCookie() : 刪除Cookie
* public void CleanHistory() : 刪除歷史記錄
* public void CleanTempFiles() : 刪除臨時文件
* public void CleanAll() : 刪除所有
*
*
*
* */
//private
///
/// 刪除一個文件,System.IO.File.Delete()函數不可以刪除只讀文件,這個函數可以強行把只讀文件刪除。
///
/// 文件路徑
/// 是否被刪除
static bool FileDelete(string path)
{
//first set the File\'s ReadOnly to 0
//if EXP, restore its Attributes
System.IO.FileInfo file = new System.IO.FileInfo(path);
System.IO.FileAttributes att = 0;
bool attModified = false;
try
{
//### ATT_GETnSET
att = file.Attributes;
file.Attributes &= (~System.IO.FileAttributes.ReadOnly);
attModified = true;
file.Delete();
}
catch (Exception e)
{
if (attModified)
file.Attributes = att;
return false;
}
return true;
}
//public
///
/// 清除文件夾
///
/// 文件夾路徑
static void FolderClear(string path)
{
System.IO.DirectoryInfo diPath = new System.IO.DirectoryInfo(path);
foreach (System.IO.FileInfo fiCurrFile in diPath.GetFiles())
{
FileDelete(fiCurrFile.FullName);
}
foreach (System.IO.DirectoryInfo diSubFolder in diPath.GetDirectories())
{
FolderClear(diSubFolder.FullName); // Call recursively for all subfolders
}
}
static void RunCmd(string cmd)
{
System.Diagnostics.Process.Start(\"cmd.exe\", \"/c \" + cmd);
}
///
/// 刪除歷史記錄
///
public static void CleanHistory()
{
string[] theFiles = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.History), \"*\", System.IO.SearchOption.AllDirectories);
foreach (string s in theFiles)
FileDelete(s);
RunCmd(\"RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1\");
}
///
/// 刪除臨時文件
///
public static void CleanTempFiles()
{
FolderClear(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));
RunCmd(\"RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8\");
}
///
/// 刪除Cookie
///
public static void CleanCookie()
{
string[] theFiles = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies), \"*\", System.IO.SearchOption.AllDirectories);
foreach (string s in theFiles)
FileDelete(s);
RunCmd(\"RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2\");
}
///
/// 刪除全部
///
public static void CleanAll()
{
CleanHistory();
CleanCookie();
CleanTempFiles();
}
}
這樣應該可以刪。