Question Delete cookies in winforms

Billie1123

Member
Joined
Oct 24, 2009
Messages
11
Programming Experience
Beginner
Hi there,

I've been trying to know how to delete all the cookies of a domain, created by using the WebBrowser control.

I know that to invalidate a cookie, it's necesary to set its expiration date in a point of the past (a negative value), but all the information I found is for web developing aplications, and I'm using a form.

I need it because the programs makes login with some accounts in a website, and I need to delete all files that the page may save on the hard disk to recognise the computer.

Thnx
 
WebBrowser shares the temp internet cache with IE, so it could be difficult for you to find which ones were created by the browser control. How to clear the cache when your application hosts a WebBrowser control in Visual Basic .NET with this you can clear all or only some temp files based on your decisions. With "Microsoft Shell Controls and Automation" COM library you can do the same, I have some related code samples here http://www.vbdotnetforums.com/vb-net-general-discussion/32860-get-files-recycle-bin.html and here http://www.vbdotnetforums.com/windows-forms/33271-web-browser-history-timestamp-pagevisited.html where you'd use the ssfINTERNETCACHE constant instead and probably GetDetailsOf and use the Delete verb.
 
mmm...

Cache has no relevance for accounts recognisement, I think.

I think I'll use the command "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 " to clean IE's temporary files.

well, here some others windows codes to clean Ie data:

echo Clear Temporary Internet Files:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8


echo Clear Cookies:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2


echo Clear History:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1


echo Clear Form Data:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16


echo Clear Saved Passwords:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32


echo Delete All:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255


echo Delete All w/Clear Add-ons Settings:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351



But I have a problem, I write:



Dim cleantemp as new process

cleantemp.startinfo.filename = "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"

cleantemp.start()

and it gives me an error, any idea?
 
Last edited:
Back
Top