Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear My friends:

I have one data file that each record consist of 3 sections. each section of each record paste to 3 richtextboxes and these textboxes.text are read and then write to a data file in the format of binary and forms one record.
I want to open a file and without reading all records, find a specefic record for example no. 3 without reading records 1 to 2. Is there any command for searching a specific string?


record1:
1. some string
2. some image file that must write as bytes
3. some sound attached to this record

record2:
1. some string
2. some image file that must write as bytes
3. some sound attached to this record

record3:
1. some string
2. some image file that must write as bytes
3. some sound attached to this record

.
.
.

so firstly, the lenght of each section of a record is not specific.
secondly, if I close the file, and I want to add some other records to the current file, I must find the no. of last record and add additional records to the file. So is it a straight forward procedure for doing this?

thirdly, how should I modify one record after I create that record?

and finally, if I want to encrypt this file is it possible for others to extract it's content?

Sincerely
Posted
Comments
[no name] 8-Mar-12 9:11am    
Why did you ask this again?
BobJanova 8-Mar-12 10:39am    
repost

1 solution

One way to do this is for each record, convert to binary, and get the length of the record in bytes. Put that record number and then the length of the record in the file before the record. This will let you read the record number, if it's not the one you want, you get the length and skip that many bytes in the file to the next record.

That's at least for your first question. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900