Solutions to clear WebBrowser caches and cookies

Source: Internet
Author: User
Tags cache and cookies

By testing WebBrowser with IE cache and cookies are stored in the local settings\temporary Internet Files, we can directly invoke IE API to clear

Solution 1:

 Public enum int  0 1 1)23   3 4 5)67  8 9   One}

[DllImport ("shell32.dll")] Static extern string string string string lpdirectory, Showcommands nshowcmd);

// Clear IE Temp file  "open" "rundll32.exe" "                    inetcpl.cpl,clearmytracksbyprocess 255"" ", showcommands.sw_hide);

Where clearmytracksbyprocess can choose settings:

Temporary Internet Files (Temporary Internet file)

RunDll32.exe Inetcpl.cpl,clearmytracksbyprocess 8

Cookies

RunDll32.exe inetcpl.cpl,clearmytracksbyprocess 2

History (historical record)

RunDll32.exe inetcpl.cpl,clearmytracksbyprocess 1

Form. Data (form)

RunDll32.exe inetcpl.cpl,clearmytracksbyprocess 16

Passwords (password)

RunDll32.exe Inetcpl.cpl,clearmytracksbyprocess 32

Delete all (remove all)

RunDll32.exe inetcpl.cpl,clearmytracksbyprocess 255

Solution 2: Quickly clear WebBrowser cookies

Wb. Document.Cookie.Remove (01))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.