TransmitFile发送超过2GB文件

PC_9527 2013-04-12 05:59:11
谁能给我写一段TransmitFile发送大于2GB文件的代码(MFC),主要就是发送端,接受端可以不管。
...全文
180 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
PC_9527 2013-04-12
  • 打赏
  • 举报
回复
引用 4 楼 lostying 的回复:
C/C++ code ? 1234 nNumberOfBytesToWrite The number of bytes in the file to transmit. The TransmitFile function completes when it has sent the specified number of bytes, or when an error oc……
我自己搞定了,超过2GB的需要传OVERLAPPED结构来设置偏移
无言猪 2013-04-12
  • 打赏
  • 举报
回复
nNumberOfBytesToWrite 
The number of bytes in the file to transmit. The TransmitFile function completes when it has sent the specified number of bytes, or when an error occurs, whichever occurs first. 

Set this parameter to zero in order to transmit the entire file.

这个参数设置为0能行不
PC_9527 2013-04-12
  • 打赏
  • 举报
回复
引用 1 楼 smwhotjay 的回复:
一样 - -.传递一个file handle
怎么会一样?超过2GB需要用偏移发送......
ShengFei01 2013-04-12
  • 打赏
  • 举报
回复
这里有很多socket例子,拿一个修改一下吧: http://download.csdn.net/detail/geoff08zhang/4571358
smwhotjay 2013-04-12
  • 打赏
  • 举报
回复
一样 - -.传递一个file handle

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧