本文介绍了帮助C#.使用文件流编辑文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,这是我的第一篇文章.我来自阿根廷,所以我会尽力做到最好的英语.

我需要以下问题的帮助.我使用NetworkStream从客户端应用程序接收到服务器应用程序的文件.收到文件后,我将其临时保存到名为"temp"的硬盘中.接收成功,每个字节都被完美接收.
我用来发送文件的协议是(不带"):"FileName | FileSize | FileContent"
现在,我需要组成最终文件,即原始文件.我可以使用FileStream创建一个新文件,其名称在temp文件中,并且可以读取其大小,但是我不知道如何在新文件中仅写入"temp" FileContent.

Hello everyone, this is my first post. I am from Argentina, so I''ll try to do the best out of my english.

I need help with the following issue. I receive a file from a client application to a server application using NetworkStream. As I receive the file, I save it temporarily to disc in a dile called "temp". The recepcion is succesfull, every byte is receive perfectly.
The protocol I used to send the file is (without "): "FileName|FileSize|FileContent"
Now I need to make up the final file, the original. I can create a new file using FileStream with the name receive in the temp file, as well as I can read its size, but I don''t know how to write only the "temp" FileContent in the new file. Is there any simple way to exclude the FileName and FileSize?

推荐答案



这篇关于帮助C#.使用文件流编辑文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 17:21
查看更多