[译]Web Sweeper-不留痕迹
By robot-v1.0
本文链接 https://www.kyfws.com/applications/web-sweeper-leave-no-trace-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1894 个词 阅读量 0[译]Web Sweeper-不留痕迹
原文地址:https://www.codeproject.com/Articles/14867/Web-Sweeper-Leave-No-Trace
原文作者:Canopener4000
译文由本站 robot-v1.0 翻译
前言
Internet History Cleaning App
互联网历史记录清理应用
介绍(Introduction)
这是我的第一篇文章,所以请耐心等待.这个程序是一个小时的懒惰工作的充实,也是我兄弟的想法,因为我没有想象力.当我开始时,我想开发一个应用程序来清理Internet Explorer留下的混乱情况,保持我的计算机平稳运行,等等.没有比这更简单的了,您所要做的就是按"扫描!!“按钮,它会删除当前用户的” Internet临时文件",清除历史记录,甚至进入注册表并删除"(This is my first post, ever, so bear with me. This program is the fulfillment of many an hour of lazy work, and was my brother’s idea since I have no imagination. When I started, I wanted to develop an application that would clean up the mess that Internet Explorer leaves behind, keeping my computer running smoothly, etc. It can’t be any simpler than this, all you have to do is press the “Sweep!” button, and it deletes the current users Temporary Internet Files, clears the history, and even goes into the registry and deletes the “)TypedUrl(TypedUrls)“文件夹,清理地址栏的混乱情况.(” folder, cleaning up the address bar clutter.)
使用代码(Using the Code)
首先,我没有在Firefox上测试过此代码,也没有在所有操作系统上进行过尝试,因此,请随它一起使用,如果您在Windows XP Home或Windows 98 SE以外的其他操作系统上进行尝试,请给我留言并告诉我它是如何工作的.为了清除历史记录,我借了一些代码(没有版权通知),这很简单,但是做得很好.要使用,您需要做的就是复制并粘贴以下包含的内容,然后粘贴代码:(Firstly, I haven’t tested this code with Firefox, nor have I tried it on all operating systems, so just go with it and if you try it on an OS other than Windows XP Home or Windows 98 SE, leave me a message and tell me how it worked. To clear the history, I borrowed some code (no copyright notifications), it’s simple but does the job great. To use, all you need to do is copy and paste in these includes and then the code:)
#include <urlhist.h>
#include <Wininet.h>
#include <shlobj.h>
#include <shlguid.h>
#include <shlwapi.h>
CoInitialize(NULL);
IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
HRESULT hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC,
IID_IUrlHistoryStg2, (void**)&pUrlHistoryStg2);
if (SUCCEEDED(hr))
{
hr = pUrlHistoryStg2->ClearHistory();
if (!(SUCCEEDED(hr)))
goto cleanup;
pUrlHistoryStg2->Release();
done++;
}
跳过一些更具体的细节(您可以下载源代码,您知道),我想跳到我最难做的功能,也许是因为我太懒了,但是通过注册表尝试找到一个文件夹是很难的东西.删除”(Skipping some of the more gritty details (you can download the source code, you know), I’d like to jump to the hardest function for me to make, maybe since I was too lazy, but going through my registry trying to find one folder is hard stuff. It’s the function that deletes the “)TypedUrl(TypedUrls)“中的文件夹(” folder in “)HKEY_USERS \ Software \ Microsoft \ Internet Explorer \ TypedURLs(HKEY_USERS\Software\Microsoft\Internet Explorer\TypedURLs)":(":)
sKey.Empty();
sKey += szSid; //szSid is a unique number identifier, the number
// is computed with a helper function "GetSidString"
sKey += \\Software\\Microsoft\\Internet Explorer\\TypedURLs;
RegSetPrivilege(HKEY_USERS, sKey, &NewSD, TRUE);
SHDeleteKey(HKEY_USERS, sKey);
有一点要注意,使用我的编译器(Microsoft Visual Studio 6.0 C ++)会生成2条警告.该程序没有任何问题,它可以正常工作,但仍以"可能丢失数据"的形式提出来.只是忘掉它们,除非您能找到一种改进程序的方法,在这种情况下,请务必给我留下评论或给我发送电子邮件.(Something to be aware of, using my compiler, which is Microsoft Visual Studio 6.0 C++, it generates 2 warnings. There is nothing wrong with the program and it works just fine, but it still comes up with them as “possible loss of data”. Just forget about them, unless you can find a way to improve the program, in which case by all means leave me a comment or send me an email.)
历史(History)
- 1.0-初始版本(1.0 - Initial release)
- 2.1-添加了功能,包括清除”(2.1 - Added functionality, including clearing the “)临时网络文件(Temporary Internet Files)“文件夹和进度条以显示应用程序的进度,并修复了一个不能清除运行Windows 98的计算机上的历史记录的错误(” folder and a Progress Bar to Show the Progress of the Application, and Fixed a bug that didn’t clear the history on computers running Windows 98)
- 2.2-现在清除”(2.2 - Now clears the ‘)温度(Temp)"(’ folder in the ‘)本地设置(Local Settings)‘文件夹,但是不会清除所有文件(’ Folder, however it doesn’t clear all of the files)
- 2.4-在出现问题后再次添加了进度条,改进了功能,效果很好(2.4 - Added progress bar again after problems, improved functionality, works great)
- 2.4b-添加了只读文本框,告诉您检测到多少个文件,而未被删除的文件是受保护的文件,或者”(2.4b - Added read-only text box to tell how many files were detected, and the files that aren’t deleted are protected files or the “)索引数据(index.dat)"(")
- 2.5-最终修复了无法清除所有自动完成表格的错误(2.5 - Finally fixed bug where all the autocomplete forms wouldn’t clear)
- 2.6-添加了一个计时器来告诉用户扫描花费了多长时间(2.6 - Added a timer to tell the user how long the sweep took)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC6 Windows WinXP MFC Visual-Studio Dev 新闻 翻译