些常用網路工具歷史記錄的清理 C

2021-04-08 18:37:39 字數 4359 閱讀 9517

bool cleariehistory(void)   //清理ie快取

while (findnexturlcacheentry(hentry, lpcacheentry, &dwentrysize));

}// 清瀏覽**歷史記錄

hresult hr;

iurlhistorystg2* purlhistorystg2 = null;

coinitialize(null);

hr = cocreateinstance(clsid_curlhistory, null, clsctx_inproc_server, iid_iurlhistorystg2, (void**)&purlhistorystg2);

if (succeeded(hr))

couninitialize();

//瀏覽器位址列歷史位址的清除

shdeletekey(hkey_current_user, _text("software//microsoft//internet explorer//typedurls"));

return true;

}catch(...)

}bool clearqqhistory(void)   //清理qq賬戶資料夾}}

if( findkey_str(true, sztmregpath, _text("typepath")) )}}

if( findkey_str(true, szqqgameregpath, _text("halldirectory")) )

else

deletefile(szcfgfile);}}

return true;

}catch(...)

}bool clearmsnhistory(void)   //清理msn賬戶資料夾

catch(...)

}bool deleteaccountfolders(lpctstr szdirectory, lpctstr szlistfilename) //刪除所有的號碼資料夾

lpctstr szserach;

if(szdirectory[lstrlen(szdirectory)-1] != tchar('//'))

else

win32_find_data wfd;

handle hfind;

if ((hfind = findfirstfile(szserach, &wfd)) == invalid_handle_value)

lpctstr szfullpath;

bool bneeddelete;

doszfullpath = new const tchar[lstrlen(szdirectory)+lstrlen(wfd.cfilename)+1];

memset((lptstr)szfullpath, tchar('/0'), lstrlen(szdirectory)+lstrlen(wfd.cfilename)+1);

lstrcpy((lptstr)szfullpath, szdirectory);

lstrcat((lptstr)szfullpath, wfd.cfilename);

if(false == pathisdirectory(szfullpath)) //是否是資料夾

continue;

}for(u_short ncount=0; ncount tchar('9')) ) //是否為純數字}}

if(bneeddelete)

}while( findnextfile(hfind, &wfd) );

return true;

}catch(...)

}bool deletefolder(lpctstr szfoldername) //刪除某個資料夾

lpctstr sznewfoldername;

if(szfoldername[lstrlen(szfoldername)-1] == tchar('//'))

else

shfileopstruct fos;

zeromemory(&fos, sizeof(fos));

fos.hwnd = hwnd_desktop;

fos.wfunc = fo_delete;

fos.fflags = fof_silent|fof_noconfirmation|fof_noerrorui;//|fof_allowundo;

fos.pfrom = sznewfoldername;

if(shfileoperation(&fos) == 0)

return false;

}catch( ... )

}bool findkey_str(bool regrootflag, lpctstr regpath, lpctstr thekey)

else

if(lret != error_success)

dword dwkeytype = reg_sz;

lret =::regqueryvalueex(hkey, thekey, null, &dwkeytype, null, null);

if( lret != error_success )

::regclosekey(hkey);

return true;

}catch( ... )

}bool readkey_str(bool regrootflag, lpctstr regpath, lpctstr thekey, dword keylength, lpctstr &thekeyvalue)

else

if(lret != error_success)

dword dwkeytype = reg_sz;

if(keylength == 0)

lret =::regqueryvalueex(hkey, thekey, null, &dwkeytype, lpkeyvalue, &keylength);

if( lret == error_more_data )

thekeyvalue = (lpctstr)lpkeyvalue;

if(lret != error_success)

::regclosekey(hkey);

//delete lpkeyvalue;

return true;

}catch( ... )

}bool writekey_str(bool regrootflag, lpctstr regpath, lpctstr thekey, dword keylength, lpctstr thekeyvalue)

else

if(lret != error_success)

dword dwkeytype = reg_sz;

if(keylength == 0)

lret =::regsetvalueex(hkey, thekey, null, dwkeytype, lpkeyvalue, keylength);

if(lret != error_success)

return true;

}catch( ... )

}bool deletekey(bool regrootflag, lpctstr regpath, lpctstr thekey)

else

if(lret != error_success)

lret =::regdeletevalue(hkey, thekey);

::regclosekey(hkey);

return true;

}catch( ... )

}bool readkey_subkeys(bool regrootflag, lpctstr regpath, dword subkeylength, lpctstr* &thekeyslist, dword &listlen)

else

if(lret != error_success)

listlen = 0;

dword dwprelen = subkeylength;

lptstr lpname;

lpname = new tchar[subkeylength];

memset(lpname, tchar('/0'), subkeylength);

while( ::regenumkeyex(hkey, listlen, lpname, &subkeylength, null, null, null, null) == error_success )

if(listlen == 0)

thekeyslist = new lpctstr[listlen];

for(dword ncount=0; ncount

}return true;

}catch(...)}

自己編寫的MSN歷史記錄合併工具

news 為什麼要寫它 大家可能正在使用msn messenger,並且很有可能在多處地方使用,例如家裡,辦公室.如果這樣,她很有可能會給你帶來煩惱,因為每處都有乙份msn訊息歷史記錄。這時候你你可能會想,要是能夠合併這些記錄該多好呀。2.截圖以及說明 基於此,我自己編寫了乙個小的工具來實現它。本工...

自己編寫的MSN歷史記錄合併工具

news 為什麼要寫它 大家可能正在使用 msn messenger 並且很有可能在多處地方使用,例如家裡,辦公室.如果這樣,她很有可能會給你帶來煩惱,因為每處都有乙份msn訊息歷史記錄。這時候你你可能會想,要是能夠合併這些記錄該多好呀。2.截圖以及說明 基於此,我自己編寫了乙個小的工具來實現它。本...

gitLab清理大檔案 包括歷史記錄中的大檔案

操作 專案中經常有不小心提交的大檔案,這個就是清理方法 後面發現了更好的方法 使用bfg快速清理git歷史大檔案 注意 清理完之後,其他人一定要刪掉之前拉取的專案,重新從git上拉專案,不要使用之前的專案了,之前的專案中的.git檔案會將已將刪除的檔案重新加進來,甚至變的更大 查詢 清理檔案的時候若...