I have a file which has records for employees data and images. Each record for one employee and his data, his image, and his wife image. I can't change the file structure
There are separators between text data and images.
Here a sample of one record:
record number D01= employee name !=IMG1= employee image ~\IMG2= wife image ^! \r\n
(D01= & !=IMG1= & ~\IMG2= & ^!) are the separators
This is the code how the file was written:
FileStream fs = new FileStream(filePath, FileMode.Create);
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
BinaryWriter bw = new BinaryWriter(fs);
sw.Write(employeeDataString);
sw.Write("!=IMG1=");
sw.Flush();
bw.Write(employeeImg, 0, employeeImg.Length);
bw.Flush();
sw.Write(@"~\IMG2=");
sw.Flush();
bw.Write(wifeImg, 0, wifeImg.Length);
bw.Flush();
sw.Write("^!");
sw.Flush();
sw.Write(@"\r\n");
sw.Flush();
So how to read that file?