How read data from .hex file in c#? [Resolved]

Posted by Allemahesh under C# on 7/19/2013 | Points: 10 | Views : 29126 | Status : [Member] [MVP] | Replies : 1
I have a .hex file and I want to read data from row by row from this .hex file. Can any one tell me how to do this?


Posted by: Jitendrasoft09 on: 7/19/2013 [Member] [MVP] Starter | Points: 50


Hi Alemahesh,

Please make sure that you are keeping the path of .hex file into fileDirectory to read the .hex file as below code is mentioned.

FileStream fs = new FileStream(fileDirectory, FileMode.Open);

int hexIn;
String hex;

for (int i = 0; (hexIn = fs.ReadByte()) != -1; i++){
hex = string.Format("{0:X2}", hexIn);

Hope you are clear.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response