Ben*_*ack 3 .net c# file-io bytearray file-conversion
给定文件的路径(例如"C:\ MyPicture.jpg"),如何将二进制文件转换为字节数组?
我知道我有很多.NET对象的在我手上,如BinaryReader,FileStream,StreamReader,等人,但我不知道把一个二进制文件,并转换成最佳的方法byte[].这怎么可能实现?
BinaryReader
FileStream
StreamReader
byte[]
SLa*_*aks 7
你在找File.ReadAllBytes(@"C:\MyPicture.jpg").
File.ReadAllBytes(@"C:\MyPicture.jpg")
Phi*_*ert 5
byte[] bytes = File.ReadAllBytes("C:\\MyPicture.jpg");
归档时间:
15 年,6 月 前
查看次数:
5723 次
最近记录:
8 年,7 月 前