如何从数据文件中获取文件名? [英] How to get filename from data file ?

查看:70
本文介绍了如何从数据文件中获取文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个FileStream对象,并通过服务器上的网络流将其发送
我在客户端收到一个包含所有文件数据的array byte [].如何获取文件名?

我不想在网络流上发送文件名.

I have a FileStream object and i send it over network stream at server
I receive a array byte[] include all data of file at client. How to get filename ?

I don''t want to send filename on network stream.

推荐答案

如果您不发送名称,那么您将无法找到它的名称.叫做. byte []仅包含文件内容,并且不以任何方式反映文件名或路径.您将不得不硬着头皮发送其他数据,无论是单独发送还是作为文件前缀/后缀发送.

[edit]错别字:用"of"代替"if":O-OriginalGriff [/edit]
If you don''t send the name, then you can''t find out what it is called. The byte[] will only contain the file content, and does not reflect the file name or path in any way. You will have to bite the bullet and send the additional data, either separately, or as a file prefix / suffix.

[edit]Typo : "of" instead of "if" :O - OriginalGriff[/edit]


这篇关于如何从数据文件中获取文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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