WebBrowser - Delete cookies etc
VB.Net
If you're using the default WebBrowser control and would like to clear your Cookies, History, Forms Data etc then the following can do this. If using a button/menu item to perform this then just add one of the following into the button or menu item's 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")
Re: WebBrowser - Delete cookies etc
I'm just curious if the process id's are still the same since upgrading to visual studio 2010 etc.
Can anyone find any problems with this code being used with VB2010/Win7 (64bit) while natively running IE8 on their system?
Re: WebBrowser - Delete cookies etc
Hi Jen
Sorry I can't help you with your question. I'm still running vb2008 on an xp machine. There may be other ways to do the above but I'm not sure. Some of the guys (and gals) on the forum are a lot more advanced than myself so maybe one of them will respond.
Regards
Colin