下载文件的代码 [英] code to download files

查看:70
本文介绍了下载文件的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google浏览后,如何将浏览结果保存到数据库中?我需要确定存储在数据库中的文件类型(.HTML,.TXT,.PDF)的代码.

After browsing by using google, how to save the browsing result in a database? I need code to detemine file type (.HTML,.TXT,.PDF) to be saved in DB.

推荐答案

您可以编写WinForm应用程序并使用WebBrowser控制.当页面被导航到(通过代码或通过链接引导控件执行此操作)时,将触发OnNavigate事件,并且还会有一个事件在文档加载后触发.
在事件处理程序中,您可以实施一种策略来发现该页面的内容,然后决定是否将其保存到磁盘.

这对您来说是可行的策略吗?

问候,

曼弗雷德(Manfred)
You can write a WinForm application and use the WebBrowser control. When a page is being navigated to (directing the control to do so by code or by following a link) the OnNavigate event is triggered and there is also an event that fires when the document has been loaded.
In your event handlers you can implement a strategy to discover the content of that page and then decide whether to save it to disk or not.

Is that a viable strategy for you?

Regards,

Manfred


这篇关于下载文件的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆