Quote:
for (int i = 1; i < CountLines-2; i++)
{
string[] lines = File.ReadAllLines(PathofFile);
You are reading the whole file about
CountLines
times.
You should put the last line
before the
for
statement.
[update]
Quote:
int offset = 9;
int length = line.Length - 11;
string Hexdata = line.Substring(offset, length);
Int64 lengthHexData = Hexdata.Length;
byte[] Hexintobyte = StringToByteArray(Hexdata);
Int64 ImageSize = Hexintobyte.Length;
TotalImageSize += ImageSize;
I looks to me you are doing many unnecessary operations. In order to get
ImageSize
value, you could simply write
ImageSize = (line.Length - 20) / 2;
Am I wrong?
[/update]