VB sets the path of webbrowser cookies and temporary folders.

Source: Internet
Author: User

The WebBrowser control in VB automatically inherits the vast majority of options of IE.
Registry path HKEY_CURRENT_USER \ "SOFTWARE \
MICROSOFT \ WINDOWS \ CURRENTVERSION \ EXPLORER \
Set the COOKIE storage path based on the values of COOKIES under User Shell Folders. We can customize it by changing this value.
The COOKIE storage path of WebBrowser. However, the COOKIE Path of IE is also changed. If you are changing this value,
After loading Webbrowser, immediately restore the value of this item to the previous value without affecting other applications. The general process is as follows:

1. Retrieve and save Cookies from the registry.
2. Change the Cookie Path in the registry.
3. Load the Webbrowser control or other Webbrowser-based applications
4. Restore the Cookie Path to the previous value

I wrote a letter to the author of the vest manager SwapCookie PT42 asking the webbrowser to set the COOKIE Path. I didn't get a reply,
Later we saw the information published by BlueFang. Thank you for choosing BlueFang!

Attached key process code and demonstration program cookie.zip

Dim tSet As String, tSet1 As String, tSet2 As String
TSet = REG. GetRegistryValue (HKEY_CURRENT_USER, "SOFTWARE \ MICROSOFT \ WINDOWS \
CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cookies ")
TSet1 = REG. GetRegistryValue (HKEY_CURRENT_USER, "SOFTWARE \ MICROSOFT \ WINDOWS \
CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cache ")
TSet2 = REG. GetRegistryValue (HKEY_CURRENT_USER,
"SOFTWARE \ MICROSOFT \ internet explorer \ MAIN", "Window Title ")


REG. SetRegistryValue HKEY_CURRENT_USER, "SOFTWARE \ MICROSOFT \ WINDOWS \
CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cookies ", Text_NewPath.Text, eString
REG. SetRegistryValue HKEY_CURRENT_USER, "SOFTWARE \ MICROSOFT \ WINDOWS \
CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cache ", Text_NewPath.Text, eString
REG. SetRegistryValue HKEY_CURRENT_USER,
"SOFTWARE \ MICROSOFT \ internet explorer \ MAIN", "Window Title", Text_Title.Text, eString

Internetsetoption INTERNET_OPTION_SETTINGS_CHANGED, 0, 0, 0
SendMessage HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0
Sleep (100)
Form2.Show

REG. SetRegistryValue HKEY_CURRENT_USER, "SOFTWARE \
MICROSOFT \ WINDOWS \ CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cookies ", tSet, eString
REG. SetRegistryValue HKEY_CURRENT_USER, "SOFTWARE \
MICROSOFT \ WINDOWS \ CURRENTVERSION \ EXPLORER \ User Shell Folders "," Cache ", tSet1, eString
REG. SetRegistryValue HKEY_CURRENT_USER, "SOFTWARE \
MICROSOFT \ internet explorer \ MAIN "," Window Title ", tSet2, eString

Type = "text/javascript">

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.