Lo unico que quiero es
Pasar un archivo "de cualquier formato" a binario y viceversa.
Archivo.rar ------> binario.txt
Binario.txt -------> Archivo.rar
e encontrado esto.
Cita:
Pero no si me sirve. private static byte[] GetPhoto(string filePath)
{
FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);
byte[] photo = reader.ReadBytes((int)stream.Length);
reader.Close();
stream.Close();
return photo;
}
{
FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);
byte[] photo = reader.ReadBytes((int)stream.Length);
reader.Close();
stream.Close();
return photo;
}
Espero que me podáis ayudar y gracias.