简体   繁体   中英

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...

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?

Steps to Clear the Cache in Visual C# .NET in the following article :

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); 
        }

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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