如何在Winforms中实现网页缓存

编程入门 行业动态 更新时间:2024-10-10 04:22:23
本文介绍了如何在Winforms中实现网页缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好, 我编写了一个可以将我访问的网站缓存在webbrowser控件中并稍后恢复的应用. 如果您使用firefox 5,请打开某些页面并关闭firefox,并使某些选项卡保持打开状态,甚至重新启动系统.再次打开Firefox,它会从缓存中加载这些页面. 如何在C#中执行此操作? 欢迎任何想法或参考

Hello, i writing an app that can cache the website i visit in the webbrowser control and resue it later. if you use firefox 5, open some pages and close firefox leaving some tabs open, even restart the system. openng firefox again, it loads those pages fron cache. how can i do this in c#? any ideas or reference are welcomed

推荐答案

我不确定是否从缓存中重新打开了网页,因为在重新启动PC并重新打开Firefox之后,页面是从Web服务器而不是从缓存中再次请求的. 但是,您可以通过保留所有访问过的页面的历史记录以及为每个条目存储一个表示当前是否打开的页面的指示符来执行类似的操作.当用户这样做时,将指示器设置为关闭,否则将那些指示器值保持打开状态,并且在您的应用程序启动时,您从历史记录中打开所有具有指示器值的页面. 祝你好运! I''m not sure if the web pages are reopened from the cache because after restarting the pc and reopening Firefox, it looks like the pages are requested from the webserver again and not from the cache. You can however do something similar by keeping the history of all visited pages and with every entry you store an indicator that represents the page currently opened or not. Set the indicator to closed when a user does this but otherwise leave those indicator values to opened and when your application is started you open all the pages from the history that have the indicator value opened. Good luck!

更多推荐

如何在Winforms中实现网页缓存

本文发布于:2023-11-30 21:50:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651580.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缓存   网页   如何在   Winforms

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!