Click here to Skip to main content
15,903,175 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionNeed some help trying to figure this out. Pin
crain198116-Nov-10 13:23
crain198116-Nov-10 13:23 
AnswerRe: Need some help trying to figure this out. Pin
Dave Kreskowiak16-Nov-10 14:55
mveDave Kreskowiak16-Nov-10 14:55 
GeneralRe: Need some help trying to figure this out. Pin
crain198116-Nov-10 16:26
crain198116-Nov-10 16:26 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak16-Nov-10 17:15
mveDave Kreskowiak16-Nov-10 17:15 
GeneralRe: Need some help trying to figure this out. Pin
crain198118-Nov-10 13:01
crain198118-Nov-10 13:01 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak18-Nov-10 13:26
mveDave Kreskowiak18-Nov-10 13:26 
GeneralRe: Need some help trying to figure this out. Pin
crain198118-Nov-10 14:35
crain198118-Nov-10 14:35 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak18-Nov-10 16:58
mveDave Kreskowiak18-Nov-10 16:58 
That's where your data structures come in. You can create your own class that tracks this information and is serializable.

In my humble opinion, Version 1 of my file format would lay out like this:
preamble bytes (signature)
64-bit integer offset of file table
encrypted file1 bytes
encrypted file2 bytes
encrypted file3 bytes
encrypted file4 bytes
encrypted file5 bytes
.
.
.
file table data

By putting the file table data at the end of the file, you make it easier to add and remove files from the archive as every time you close the archive, you have to write the file table to the end of the file, at a easily obtainable offset. Once that is written, you can update the fixed length 64-bit integer offset with the beginning of the file table.

Like I said, this would be my version 1 layout. Version 2 would probably add a file header to each file with checksum and length data and maybe a second copy of the file table data for backup purposes. You could even write a tool to recover salvagable files from a corrupted archive if you so choose.

Why WOULDN'T I do this? Because if the archive gets damaged, your archive isn't supported by ANY recovery and analysis tools used on other well-known file formats, unless you write these tools yourself.

GeneralRe: Need some help trying to figure this out. Pin
crain198119-Nov-10 1:55
crain198119-Nov-10 1:55 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak19-Nov-10 10:29
mveDave Kreskowiak19-Nov-10 10:29 
GeneralRe: Need some help trying to figure this out. Pin
crain198119-Nov-10 11:44
crain198119-Nov-10 11:44 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak20-Nov-10 13:59
mveDave Kreskowiak20-Nov-10 13:59 
GeneralRe: Need some help trying to figure this out. Pin
crain198120-Nov-10 14:52
crain198120-Nov-10 14:52 
GeneralRe: Need some help trying to figure this out. Pin
crain198119-Nov-10 11:11
crain198119-Nov-10 11:11 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak18-Nov-10 13:30
mveDave Kreskowiak18-Nov-10 13:30 
AnswerRe: Need some help trying to figure this out. Pin
Luc Pattyn16-Nov-10 17:24
sitebuilderLuc Pattyn16-Nov-10 17:24 
GeneralRe: Need some help trying to figure this out. Pin
crain198118-Nov-10 12:24
crain198118-Nov-10 12:24 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak18-Nov-10 13:28
mveDave Kreskowiak18-Nov-10 13:28 
GeneralRe: Need some help trying to figure this out. Pin
crain198118-Nov-10 14:34
crain198118-Nov-10 14:34 
GeneralRe: Need some help trying to figure this out. Pin
crain198119-Nov-10 15:05
crain198119-Nov-10 15:05 
GeneralRe: Need some help trying to figure this out. Pin
Dave Kreskowiak20-Nov-10 13:18
mveDave Kreskowiak20-Nov-10 13:18 
QuestionDatagridView combined with DataSet Pin
jan_le15-Nov-10 21:48
jan_le15-Nov-10 21:48 
AnswerRe: DatagridView combined with DataSet Pin
Scubapro15-Nov-10 22:30
Scubapro15-Nov-10 22:30 
GeneralRe: DatagridView combined with DataSet Pin
jan_le16-Nov-10 3:20
jan_le16-Nov-10 3:20 
GeneralRe: DatagridView combined with DataSet Pin
Dave Kreskowiak16-Nov-10 3:46
mveDave Kreskowiak16-Nov-10 3:46 

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.