机器关闭时,应用程序需要连续运行 [英] Application need to run continously when machine Shutdown

查看:78
本文介绍了机器关闭时,应用程序需要连续运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在用wpf开发下载管理器.因此,当我运行具有暂停和恢复功能的项目时,因此在下载过程中,我的应用程序将关闭.我的下载需要暂停.然后重新启动我的应用程序,它将恢复下载.
就像Torrent下载器一样.
谢谢,
Prabu

Hi,
i am developing Download manager in wpf.So when i run my project that has pause and resume.So during download process going on my application will shut down.my download need to pause.then i restatrt my application it will resume downloading.
Like Torrent downloader.
Thanks,
Prabu

推荐答案

关闭时,您无需对当前正在运行的进程执行任何特殊操作即可从文件的一部分开始继续下载相同的文件之前已下载.使用HTTP下载时,您可以跳过其中的一部分,然后开始下载下一个块,将其附加到具有已下载数据的文件中.

如果查看我为CodeProject提供的应用程序HttpDownloader(包含完整的源代码),则可以找到如何使用此简单技术的信息,请参阅
You don''t need to do anything special to a currently running process at shutdown to continue downloading of the same file starting from the part of the file which was downloaded before. With HTTP downloads, you can skip part of it and start to download next block appending it to the file with already downloaded data.

You can find out how to use this simple technique if you look at my application HttpDownloader I provided for CodeProject with complete source code, please see how to download a file from internet[^]. (This is C#. Too bad you did not indicate your language.)

—SA


这篇关于机器关闭时,应用程序需要连续运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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