Clear WebBrowser control browsing history

后端 未结 2 948
借酒劲吻你
借酒劲吻你 2021-02-10 09:14

I want to clear WebBrowser control history after WebBrowser completes its browsing.

2条回答
  •  猫巷女王i
    2021-02-10 09:25

    Actually, there are two types of history. One is "Visited" pages list, and the other is the actual history you see in IE's history user interface.

    If you want to remove the visited pages list, you need to use DeleteUrlCacheEntry to delete each item. By looping through using FindFirst/NextUrlCacheEntry API's you can get access to the time and date these items were creates, and therefore only delete the items created after your browser session started and before it was finished.

    For FindFirst/NextUrlCacheEntry and DeleteUrlCacheEntry information, there are pre-written codes online that you can use, and then it will be easy for you to create a filter to decide which items you want deleted when you are looping through these cache entries.

    Let me know if I can be of further assistance.

提交回复
热议问题