Original Post
I want to convert this: To C#. I tried this -> to get the name and id vaulues but get strange results... [Edited by - brwarner on July 12, 2006 9:03:31 AM]
Open fzpath For Binary As #free
Get #free, 1, floop
ReDim files(floop)
For fcount = 1 To floop
'structlen = 50 = sizeof(files)
Get #free, (fcount * structlen) + 5, files(fcount).offset
Get #free, (fcount * structlen) + 5 + 4, files(fcount).length
Get #free, (fcount * structlen) + 5 + 8, files(fcount).name 'string * 10
Get #free, (fcount * structlen) + 5 + 18, files(fcount).type
Get #free, (fcount * structlen) + 5 + 22, files(fcount).type2
Get #free, (fcount * structlen) + 5 + 26, files(fcount).width
Get #free, (fcount * structlen) + 5 + 28, files(fcount).height
Get #free, (fcount * structlen) + 5 + 30, files(fcount).unk1
Get #free, (fcount * structlen) + 5 + 31, files(fcount).unk2
Get #free, (fcount * structlen) + 5 + 32, files(fcount).unk3
Get #free, (fcount * structlen) + 5 + 33, files(fcount).unk4
Get #free, (fcount * structlen) + 5 + 34, files(fcount).unk5
Get #free, (fcount * structlen) + 5 + 36, files(fcount).unk6
Get #free, (fcount * structlen) + 5 + 38, files(fcount).unk7
Get #free, (fcount * structlen) + 5 + 42, files(fcount).fnum
Get #free, (fcount * structlen) + 5 + 46, files(fcount).rlength
'Form1.List1.AddItem files(fcount).name
'50
Next fcount
BinaryReader s = new BinaryReader(File.Open(input,FileMode.Open,FileAccess.Read));
long floop = s.ReadInt64();
string[] names = new string[floop];
long[] sizes = new long[floop];
for (int i = 0; i < floop; i++)
{
s.BaseStream.Seek(50 * i + 8 + 5, SeekOrigin.Begin);
names = new string(s.ReadChars(10));
s.BaseStream.Seek(50 * i + 42 + 5,SeekOrigin.Begin);
sizes = s.ReadInt64();
}
s.Close();
return null;