简体   繁体   中英

How to paste a byte array into a file c#?

When my program starts, i get the byte array of a file (file a), then i send that byte array to paste it into another file (file b), like creating a copy of my first file.

The Question is, how do i open the "file b" and paste the binary info to create a copy of my "file a"?

You can write a byte[] directly to a file path.

using System.IO;

byte[] byteArray;
string path = @"C:\fileB.txt"

File.WriteAllBytes(path, byteArray);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM