登录
首页 » Windows开发 » 局域网文件传输 为了设计统一和用户操作方便,我们希望将服务端与客户端融合在一起,形成一个程序,这样用户理解起来,更加直观一点(其实这样做也是为了方便调试,大...

局域网文件传输 为了设计统一和用户操作方便,我们希望将服务端与客户端融合在一起,形成一个程序,这样用户理解起来,更加直观一点(其实这样做也是为了方便调试,大...

于 2022-04-14 发布 文件大小:10.97 kB
0 107
下载积分: 2 下载次数: 1

代码说明:

局域网文件传输 为了设计统一和用户操作方便,我们希望将服务端与客户端融合在一起,形成一个程序,这样用户理解起来,更加直观一点(其实这样做也是为了方便调试,大家可以在本机上测试,自己传文件给自己)。所以,我们在程序中需要使用两个Winsock控件,一个负责监听,一个负责发送,当发送端连接成功以后,便选择一个待发送的文件(可以是任意二进制文件),接着将文件名和文件字节长度发送给接收端,接收端收到这个消息以后,将文件名和文件长度解析出来,然后通知发送端可以开始发送文件;发送端读到这个消息之后,将文件流以字节的形式发送到接收端,接收端收到后,将二进制流回写,保存成文件即可。这里要注意两点,一个是由于Winsock每次最大传输8K的内容,所以需要将文件分解,每次传输固定数目的字节流,这样发送和接收时都可以根据这个数目来判断文件传输的进程,一旦字节流数目等于文件的大小,就需要关闭相应的文件句柄;另一点是由于我只使用一个Winsock控件接收,接收文本时需要注意要将UNICODE转码,解析成可识别的信息。 -LAN file transfer to uniform design and user convenience, we hope it will end service and client together and form a process so that users understand, a more intuitive 1:00 (in fact, do so in order to facilitate debugging, you can test the machine, its own text- items for himself). Therefore, we need procedures in the use of two Winsock Control, a charge of wiretapping, a charge of this, when the transmitter connects successfully, it will be a choice to send the document (can be arbitrary binary files), will then file names and the

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 数据处理程序 有一定的法则选出最佳数据这是我在课程设计时做的...
    数据处理程序 有一定的法则选出最佳数据这是我在课程设计时做的-Data-processing procedures have certain rules select the best data on this is my time to do in the curriculum design of
    2023-04-23 16:00:04下载
    积分:1
  • 这是一个文件的武装土匪
    this a file for a n armed bandit-this a file for a n armed bandit
    2022-03-25 02:16:53下载
    积分:1
  • internet explorer password promt
    internet explorer password promt
    2022-10-30 22:10:03下载
    积分:1
  • 基于Android的家用电器管理系统
    项目目标:一款用于帮助用户管理家电信息,清洗报修家用电器的管理系统采用的技术:Android、java、js、css、html完成情况:成品可通过扫描二维码,拍照等方式记录家电信息,对家电进行分类,进行清洗维修预约等方面。
    2022-03-12 09:56:50下载
    积分:1
  • WiiMultipointGrid_calibration.zip wii蓝牙遥控器,实现多点操作
    WiiMultipointGrid_calibration.zip wii蓝牙遥控器,实现多点操作-WiiMultipointGrid_calibration.zipwii Bluetooth remote control, realize multi-point operation
    2022-08-03 10:33:55下载
    积分:1
  • converts from different units of weight from metric to imperial and vica versa.
    converts from different units of weight from metric to imperial and vica versa.
    2023-07-07 11:25:02下载
    积分:1
  • 此源码在代理中检查您的知识产权
    this Source to check your ip in proxy
    2023-04-03 14:10:03下载
    积分:1
  • This procedure can be found on the attribution of the designated mobile phone nu...
    本程序可查指定手机号码的归属地,是通过获取IP138上的数据。把上面的所有广告信息全部出除了。 为了支持原创,请保留该处注释,谢谢! 作者:下载摆渡 上百度 下摆渡,摆资料 渡难关 下载摆渡 http://www.downbaidu.com 超过10万的海量信息与知识,并以日增数千的速度递增; 包罗万象的资讯类别,提供管理、营销、教育、专题等无限数据; 本站PR=3 本站愿与同类网站做友情连接 QQ:174322509-This procedure can be found on the attribution of the designated mobile phone number, it is through access to data on IP138. The above information on all advertising except all out. In order to support the original, please preserve the notes, thank you! Author: download ferry on the ferry the next Baidu, to tide over the crisis facing the information downloaded more than 100,000 ferry http://www.downbaidu.com mass of information and knowledge, and increasing the speed of thousands of incremental all-inclusive category of information, provide management , marketing, education, topics such as infinite data site PR = 3 site is willing to work with to do the same Web site Link QQ: 174322509
    2023-04-23 02:05:03下载
    积分:1
  • USB串行驱动程序的Windows移动
    usb to serial driver for windows mobile
    2022-04-06 12:17:26下载
    积分:1
  • Turbo C
    一个用C语言编写的现实一个箭头的代码,编辑器为TURBO C.-turbo c
    2023-05-21 05:55:03下载
    积分:1
  • 696518资源总数
  • 105531会员总数
  • 4今日下载