如何使用C#清除IE历史记录而不显示UI [英] How to clean IE history with C# without showing an UI
问题描述
我想知道如何在没有显示UI的情况下用C#清理历史记录(不是缓存和cookie)。
我试过这个,但它什么都没清理,另外我的应用程序在加载5秒后冻结并显示Internet Explorer清理向导的UI:
I would wonder how to clean the history (not cache and cookies) with C# without showing an UI.
I have tried this, but it cleans nothing, freezes additionally my application on load 5 seconds and shows anyway the UI of the Internet Explorer Cleaning Wizard:
var psi = new System.Diagnostics.ProcessStartInfo("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 8");
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
Process P1=Process.Start(psi);
有人在C#中使用代码来清理IE历史记录类文件易于使用?
我到目前为止只找到历史查看器。
这里我不需要任何历史查看器示例我只需要清理它。
谢谢!
Has someone a code in C# to clean the IE History in one class file for easy use?
I found only History Viewers so far.
Here I don't need any History Viewer Examples whatsoever I just need to clean it.
Thank you!
推荐答案
在文章中搜索url history会出现这个 [ ^ ]。
Searching the articles for "url history" comes up with this[^].
要输入的正确命令行是:
而不是'8'必须是这里写着'1'。
The right command line to input would be:
Instead of '8' must be here the '1' written.
var psi = new System.Diagnostics.ProcessStartInfo("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 1");
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
Process P1=Process.Start(psi);
IE清洁向导的窗口无法隐藏我的内容已经尝试过,冻结继续运行它,只是为了那些希望删除冻结和窗口的人的信息。
至于API解决方案我在这里找到它:'expert-exchange {dot} com'。
这一价值一百二十美元。只需注册并支付该金额。
它包含历史查看器示例中的那些API,但是以一种有效且可用的方式。这个网站上的API示例较旧,对于VS 2005,因此它不适用于VS 2008的历史记录查看器。这就是我要讲的所有内容。
The window of the IE Clean Wizard cannot be hidden with what I have tried and the freeze continues on running it, just for information for those who wish to remove the freeze and the window.
As for the API solution I found it here: 'experts-exchange{dot}com'.
It was worth a hundred and twenty bucks. Just register and pay that sum too.
It contains those API as in the history viewer example but in a working and usable manner. Those API example here on this site is older and for VS 2005, so it doesn't work the history viewer for VS 2008. That's all what I gonna tell about it.
这篇关于如何使用C#清除IE历史记录而不显示UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!