Open .txt file as bytes in C # [closed]

0

My class has to open a .txt file which contains some characters in ASCII, when opening it, this file must be stored in a byte [], in order to extract some specific locations from the document and to be able to modify it

    
asked by alan morales 28.06.2017 в 21:10
source

1 answer

2

System.IO.File.ReadAllBytes(nombreArchivo)

This method returns the contents of a file in the form of byte[] .

Example:

byte[] contenido = System.IO.File.ReadAllBytes("c:/miarchivoTexto.txt");
    
answered by 29.06.2017 в 19:06