使用C#读取/写入所有类型文件的常用方法 [英] Common method to read/write all types of files using C#

查看:599
本文介绍了使用C#读取/写入所有类型文件的常用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发一个ASP.NET,其中有一个文件上传"控件.因此,用户可以上传任何格式的文件,例如.doc,.pdf,.docx,.txt,.rtf,.ppt,.odt等.因此,程序必须能够从这些格式的任何文件中读取数据.我不想为每种文件格式使用不同的第三方库.我想要一种通用的解决方案来读取所有这些文件.

在此先感谢

Hi,
I am developing an ASP.NET in which I have a "fileupload" control. So, User may upload files of any format like .doc, .pdf, .docx, .txt, .rtf, .ppt, .odt etc. SO, the program must be able read data from any file of these formats. I dont want to use different third party libraries for each of these file formats. I want one common solution to read all these files.

Thanks in advance

推荐答案

我要


小额钞票中的100,000,000.
我怀疑我们都会感到失望.

没有办法读取所有类型的文件",或者至少没有办法使信息可用.您可以将任何文件类型读取为二进制文件,但是读取的内容将无法理解.

每个应用程序都以一种适合自己的方式存储数据-不利于其他应用程序.您需要为每种文件类型使用一个库,或者编写自己的转换器.
100,000,000 in small bills.
I suspect we will both be disappointed.

There is no way to "read all types of files" - or at least, none which will render the information usable. You can read any file type as a binary file, but the content you read will not be understandable.

Each application stores it''s data in a way that is good for it - not good for other applications. You need to either use a library for each file type, or write your own converter.


这篇关于使用C#读取/写入所有类型文件的常用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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