简体   繁体   中英

Deleting IE6 cookies programmatically

Is there a way to delete IE6 cookies programaticaly? I have come across solutions for IE7 and IE8 using something like RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 but this does not work for IE6. I've tried a simple batch file to delete the contents of temporary internet files folder but that fails due to some files being in use.

The proper way to do this is to use the WinINET cache enumeration functions (FindFirstUrlCacheEntry, FindNextUrlCacheEntry) to enumerate the cookie store, then call DeleteUrlCacheEntry on each cookie.

http://support.microsoft.com/kb/326201 has a related code sample to get you started.

There are many command line utilities that will do this if you're just looking for a scriptable solution and don't actually need to integrate the code into some larger project...

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