Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows Service in C#.Net 2.0, moving files from directory Pin
adnanrafiq28-Feb-07 18:54
adnanrafiq28-Feb-07 18:54 
GeneralRe: Windows Service in C#.Net 2.0, moving files from directory Pin
gus_br1-Mar-07 1:17
gus_br1-Mar-07 1:17 
QuestionHow to diplay web page inside another web page window? Pin
cebyrjoe228-Feb-07 9:27
cebyrjoe228-Feb-07 9:27 
AnswerRe: How to diplay web page inside another web page window? Pin
Wayne Phipps28-Feb-07 9:46
Wayne Phipps28-Feb-07 9:46 
AnswerRe: How to diplay web page inside another web page window? Pin
Vasudevan Deepak Kumar28-Feb-07 14:38
Vasudevan Deepak Kumar28-Feb-07 14:38 
QuestionHow to retrieve non fixed-length records from a binary file Pin
htres28-Feb-07 9:20
htres28-Feb-07 9:20 
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn28-Feb-07 10:14
sitebuilderLuc Pattyn28-Feb-07 10:14 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
htres1-Mar-07 3:04
htres1-Mar-07 3:04 
Thanks for the suggestions! Unfortunately, I am receiving this binary file from a third party and it's format is out of my control. Frown | :(

The fields in the records seem to be seperated by a zero byte, and the records are seperated by a 16 byte string. Also, I noticed that the jpeg data starts with the bytes (in HEX) FF, D8, FF, E0 and ends with FF, D9. Could I possibly use these byte sequences to identify the jpeg?

Also, I'm very new to this so all I have figured out how to do so far in code is to read my fixed length fields like so:

FileStream fs = File.OpenRead(strFileName);
BinaryReader reader = new BinaryReader(fs);

//reads the first 36 bytes of trash
reader.ReadBytes(36);

//reads and stores the record delimiter string
string strSignature = Encoding.ASCII.GetString(byteSignature);

//advances the curser 1 byte
reader.ReadBytes(1);

//stores SKS ID
string strSKSID = Encoding.ASCII.GetString(reader.ReadBytes(16));

//advances the curser 1 byte

etc... reading down until I get to the image field.

Luc Pattyn wrote:
If you cant follow the above scheme (e.g. because the file format has been fixed
and does not include a type byte), then you need to determine the type of the next record
by reading and analyzing some bytes, then rewind a bit (using
Seek method or Position property) and Load a record; repeat until done.


I'm not sure how to actually implement your suggestion of reading and analyzing some bytes, then rewinding. Could you provide some example code?

Thanks again!
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn1-Mar-07 7:07
sitebuilderLuc Pattyn1-Mar-07 7:07 
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
htres5-Mar-07 4:48
htres5-Mar-07 4:48 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn5-Mar-07 11:14
sitebuilderLuc Pattyn5-Mar-07 11:14 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
htres5-Mar-07 13:11
htres5-Mar-07 13:11 
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
DavidAtAscent28-Feb-07 14:12
DavidAtAscent28-Feb-07 14:12 
QuestionHow to add new control instances with sprcified name from within a custom control at design time Pin
Galib Anwar28-Feb-07 9:08
Galib Anwar28-Feb-07 9:08 
QuestionRegistering a COM component to use in VB6 Pin
gus_br28-Feb-07 8:31
gus_br28-Feb-07 8:31 
AnswerRe: Registering a COM component to use in VB6 Pin
mike montagne28-Feb-07 8:43
mike montagne28-Feb-07 8:43 
AnswerRe: Registering a COM component to use in VB6 Pin
DavidAtAscent28-Feb-07 13:49
DavidAtAscent28-Feb-07 13:49 
QuestionDataGridView DataBinding problem Pin
royk12328-Feb-07 8:11
royk12328-Feb-07 8:11 
QuestionHow to Fix the Column Width? Pin
Khoramdin28-Feb-07 8:03
Khoramdin28-Feb-07 8:03 
AnswerRe: How to Fix the Column Width? Pin
Ed.Poore28-Feb-07 8:18
Ed.Poore28-Feb-07 8:18 
Questionc# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com28-Feb-07 7:52
jtamil2001@yahoo.com28-Feb-07 7:52 
AnswerRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz28-Feb-07 7:57
Stefan Troschuetz28-Feb-07 7:57 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com1-Mar-07 0:38
jtamil2001@yahoo.com1-Mar-07 0:38 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz1-Mar-07 0:57
Stefan Troschuetz1-Mar-07 0:57 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com1-Mar-07 4:35
jtamil2001@yahoo.com1-Mar-07 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.