Library to read MANY document-file formats?
I am developing an ASP.NET in which I have a "file upload" control. So, User may upload files of any format like .doc, .pdf, .docx, .txt, .rtf, .ppt, .odt etc.
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.
You can use File.RreadAllBytes() method of System.IO namespace to read all the bytes of an file into byte array. You can get more information about this method here
As you said you are developing Asp.net application. So I think you must be using fileupload control. If yes then you can use FileUpload control's FileBytes property to read all the bytes of an file. More information about FileUpload control can be found here
精彩评论