我正在使用 C# 制作下载器,我想添加暂停和恢复下载的功能,我搜索并实施了建议,但它对我不起作用;正在从正确的位置恢复,但与下载的部分合并时出现问题。我通过下载视频文件对其进行了测试,但在暂停下载并再次启动后,结果文件播放了一段时间(它播放了暂停前下载的部分,但不播放暂停后的部分)。
我怎样才能成功合并这两个部分。
我正在使用 C# 制作下载器,我想添加暂停和恢复下载的功能,我搜索并实施了建议,但它对我不起作用;正在从正确的位置恢复,但与下载的部分合并时出现问题。我通过下载视频文件对其进行了测试,但在暂停下载并再次启动后,结果文件播放了一段时间(它播放了暂停前下载的部分,但不播放暂停后的部分)。
我怎样才能成功合并这两个部分。
We can't figure out what's wrong with your code, because we can't see your code (it's not always enough to post the source using which you made your own code).
Either way, you can try this: Create a file with some easy to spot bit pattern (like 0101010101010101...) using some hex-editor, and try to see where it breaks. If, for instance, the second part of the download keeps running over the few last bits of the first part, that would give you some clue.