Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Clear WebBrowser control 'Cache'?

How to Clear WebBrowser control 'Cache'?

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Trapper Hell
    wrote on last edited by
    #1

    I have created a program to enter sites and preview them in the WebBrowser control. The problem is that sometimes when I login to a site, for example it says: "Welcome Trapper" and afterwards if I intend to login to the site with a different user, it would not allow this, by still saying "Welcome Trapper". The website has no logout feature, and is probably intended to preserve the user after being logged in. If you close the program and open it up again, the site would require a username and password (which is what I need) but it is not efficient to have to close and open your program every time a login is to be made. I have already implemented the code below: HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); HttpWebRequest.DefaultCachePolicy = policy; but I need to find something which will totally remove any tracks of the user so the site will ask for my login creditentials every single time... Any help?

    A 1 Reply Last reply
    0
    • T Trapper Hell

      I have created a program to enter sites and preview them in the WebBrowser control. The problem is that sometimes when I login to a site, for example it says: "Welcome Trapper" and afterwards if I intend to login to the site with a different user, it would not allow this, by still saying "Welcome Trapper". The website has no logout feature, and is probably intended to preserve the user after being logged in. If you close the program and open it up again, the site would require a username and password (which is what I need) but it is not efficient to have to close and open your program every time a login is to be made. I have already implemented the code below: HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); HttpWebRequest.DefaultCachePolicy = policy; but I need to find something which will totally remove any tracks of the user so the site will ask for my login creditentials every single time... Any help?

      A Offline
      A Offline
      aj esler
      wrote on last edited by
      #2

      If the site uses cookies, that might be causing the auto login. Depending on how many sites your app works with, you could try simply deleting the cookie each time before you load up the site.

      D 1 Reply Last reply
      0
      • A aj esler

        If the site uses cookies, that might be causing the auto login. Depending on how many sites your app works with, you could try simply deleting the cookie each time before you load up the site.

        D Offline
        D Offline
        dialaya
        wrote on last edited by
        #3

        Hi, I have the same problem.... Have you solved your problem? How? Please let me know..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups