简体   繁体   English

在C#中清除WebBrowser控件密码

[英]Clearing WebBrowser Control Passwords in C#

I am working on a baby browser on my C#.Net Application that navigates normally as a normal browser and go back and forward, Stop, Refresh... 我正在C#.Net应用程序上的一个婴儿浏览器上工作,该浏览器可以像普通浏览器一样正常导航,并可以前进,后退,停止,刷新...

But there is one thing I can't manage to accomplish it, clearing Password Cache.. 但是有一件事我无法完成,清除了密码缓存。

How can I possibly do this using C#.Net code? 如何使用C#.Net代码执行此操作?

Steps to Clear the Cache in Visual C# .NET in the following article : 以下文章中清除Visual C#.NET中的缓存的步骤:

Microsoft Support 微软支持

Edit : Alternative in case previous didn't work : 编辑:如果以前不起作用,请选择:

private void button1_Click(object sender, EventArgs e)
{
    clearIECache();
}

void clearIECache()
{
    ClearFolder(new DirectoryInfo(Environment.GetFolderPath
       (Environment.SpecialFolder.InternetCache)));
}

void ClearFolder(DirectoryInfo folder)
{

        foreach (FileInfo file in folder.GetFiles())
        {
            try
            {
                file.Delete();
            }
            catch (Exception ex) // files used by another process exception
            {

            }
        }
        foreach (DirectoryInfo subfolder in folder.GetDirectories())
        {
            ClearFolder(subfolder); 
        }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM