Results 1 to 5 of 5

Thread: [RESOLVED] Delete Cache or Cookies in my Web browser

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    3

    Resolved [RESOLVED] Delete Cache or Cookies in my Web browser

    I have a web browser named Webbrowser1 and I wish to have it clear cookies when I click a button. Anyone know how?

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Delete Cache or Cookies in my Web browser

    When you create a WebBrowser using the WebBrowser component, you're not actually creating a WebBrowser. You're just adding your own GUI to a strip downed version of IE.

    That being said, the WebBrowser component inherits its cache, cookies, and other temporary file locations from IE's locations.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    Re: Delete Cache or Cookies in my Web browser

    Below is a full list of the codes I use for deleting cache, cookies, history, forms data etc. Just paste the one you want into your buttons click event.
    Code:
    'Temporary Internet Files
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 8")
            
    'Cookies
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 2")
    
    'History
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 1")
    
    Form(Data)
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 16")
    
    Passwords
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 32")
    
    Delete(All)
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 255")
    
    'Delete All – Also delete files and settings stored by add-ons 
    System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 4351")
    Hope this helps.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

  4. #4
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Delete Cache or Cookies in my Web browser

    Launching an external executable to clear these settings provides unnecessary overhead.

    These paths are built into the framework. Their located within the System.IO namespace, within [/b]Environment[/b], I believe.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  5. #5
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    Re: Delete Cache or Cookies in my Web browser

    Quote Originally Posted by weirddemon View Post
    Launching an external executable to clear these settings provides unnecessary overhead.

    These paths are built into the framework. Their located within the System.IO namespace, within [/b]Environment[/b], I believe.
    These paths are indeed built into the Environment namespace. I did some research for deleting cookies etc when I was creating my own web browser application and all of the code I could find to do what I wanted involved multiple lines of code, some of which were quite large. Not sure how Internet Explorer does this, code wise, but the dialogues that appear when these processes are run appear exactly the same as the Internet Explorer ones.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width