Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert a file to a string
Message
De
25/07/2014 09:34:22
 
 
À
25/07/2014 02:36:27
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01604630
Message ID:
01604651
Vues:
29
>It depends
>
>A file is a sequence of bytes and can be any of 3 types
>
>(1) purely binary, eg image
>
>(2) Text. In that case you have to know the encoding ( any of single byte char encodings, any of the double byte chat encodings, utf-8, utf-16 little endian, utf16 big endian, utf-32 little endian, utf32 big endian) before you can convert the byte sequences into chars. Some times there is the BOM at the beginning of the file, sometimes not
>
>(3) Mixed type, eg a database file, a word document, ...
>In there there will be binary data (control bytes that indicate a length, the type that follows) and text
>
>If you want to be on the safe side to read the file into memory - and perhaps output it again with another name), treat the file as a sequence of bytes
>
>In that case you would have, either FileToByteArray() or FileToMemoryStream()

Thanks, I guess I will leave it as is for now.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform