byte[] fileNameByte = Encoding.ASCII.GetBytes(fileName); byte[] fileData = File.ReadAllBytes(filePath + fileName); byte[] Data = new byte[4 + fileNameByte.Length + fileData.Length]; byte[] fileNameLen = BitConverter.GetBytes(fileNameByte.Length); fileNameLen.CopyTo(Data, 0); fileNameByte.CopyTo(Data, 4); fileData.CopyTo(Data, 4 + fileNameByte.Length);
fileNameLen.CopyTo(Data, 0); fileNameByte.CopyTo(Data, 4); fileData.CopyTo(Data, 4 + fileNameByte.Length);
Data
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)