Convert assembly to byte []

I am trying to convert an assembly compiled with ICodeCompiler to byte []. How can i do this? Also the safest way to transfer this assembly to a remote location (client)? Please note that synchronization of the Symmetric Key is not possible.

Update: How about this?

        BinaryFormatter formatter = new BinaryFormatter();
        MemoryStream assemblyStream = new MemoryStream();
        formatter.Serialize(assemblyStream, loAssembly);

How to transfer byte []?

+3
source share
3 answers

The last time I checked the files, they were usually stored as bytes on the hard drive.

So what is your exact problem?

+2
source

Save the assembly using one of the Stream method overloads to an instance of MemoryStream. Then you can read the byte [] stream back from the MemoryStream.

-Oisin

+1

, , . , (wikipedia ), , . ? , ftp, ssh ftp? - () , ? ? , , , "" .

0

Source: https://habr.com/ru/post/1704977/


All Articles