C#"通过&QUOT清除Internet临时文件; [英] Clear temporary internet files via "C#"

查看:145
本文介绍了C#"通过&QUOT清除Internet临时文件;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用application.i被查看的WebBrowser控件内链接内容的窗口WebBrowser控件。这里的URL内容值存储在用户机器的Internet临时文件。

I am using webbrowser control in windows application.i was viewing url content inside the webbrowser control. here the url content values are stored in temporary internet files of user machine.

当我点击我的窗体关闭按钮,我一直在编程删除Internet临时文件。它是工作的罚款。
,而删除过程中的消息框来了,说删除Internet临时文件。

when i click close button in my form i was deleting the temporary internet files programatically. and it is working fine. but during deletion a "message box came and saying deleting temporary internet files".

在这里我不想删除的过程中表明对话框。低于
为代码删除用户机器上的临时文件。

here i dont want to show that dialog box during deletion. below is code to delete the temp files for users machine.

如何处理这个..

   void DeleteBrowserTempFile()
    {
        string args = "";
        args = ("InetCpl.cpl,ClearMyTracksByProcess 8");
        System.Diagnostics.Process process = null;
        System.Diagnostics.ProcessStartInfo processStartInfo;
        processStartInfo = new System.Diagnostics.ProcessStartInfo();
        processStartInfo.FileName =    Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\Rundll32.exe";
        if ((System.Environment.OSVersion.Version.Major >= 6))
        {
            //  Windows Vista or higher
            processStartInfo.Verb = "runas";
        }
        processStartInfo.Arguments = args;
        processStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        processStartInfo.UseShellExecute = true;
        try
        {
            process = System.Diagnostics.Process.Start(processStartInfo);
        }
        catch (Exception ex)
        {
            Utilities.WriteErrorLog(ex);
        }
        finally
        {
            if (!(process == null))
            {
                process.Dispose();
            }
        }
    }






有没有其他的方式来实现这个..
需要乌尔举例建议


is there any other way to achieve this.. need ur suggestions with examples

关于

Anbuselvan

推荐答案

尝试微软建议的内容:
http://support.microsoft.com/kb/326201

Try what Microsoft advises: http://support.microsoft.com/kb/326201

这篇关于C#"通过&QUOT清除Internet临时文件;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆