Using VisualBasic 6 Random Access Files in dotnet

P

Peter

Hi

I will use a Random Access File in dotnet/csharp. The file is created
with Visual Basic 6 (VB6).

My Problem is to find out the corresponding Types I had to use in
dotnet - reading the VB6 binary values.

If there are no corresponding Types I will manually convert the VB6
binary values (e.g. BinaryFormatter...). Where can I find the
definition how VB6 write Types to a random acces file ?

Thank you
Peter
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You have to know the format used in VB6 and then you can use a compatible
type in .NET, if no compatible type exist most probably you can find an
equivalent.
 
C

christery

Hi
And a example of this would be? VB6 binary sounds exiting...
Oh might not be UTF-8 encoded... there is a fix for that...
big/little endian? nope... dont think so...

Hmm... no more ideas...

//CY
 
N

Norman Diamond

And a example of this would be? VB6 binary sounds exiting...

The language exited but the files remain.
Oh might not be UTF-8 encoded... there is a fix for that...

Of course the files weren't UTF-8 encoded. Binary data had to avoid the
corruption that would be caused by converting between ANSI and Unicode.
Text data had to be displayable by applications like Notepad on operating
systems like Windows 98. Microsoft handled the binary part pretty well, but
they lost data in the text part. Anyway, when reading an existing file, the
binary part should be pretty well readable, and the portion of the text part
that wasn't lost can be read by calling MultiByteToWideChar.
big/little endian? nope... dont think so...

Right. The names of the binary types have changed, but the actual binary
formats haven't.
 
C

christery

Right.  The names of the binary types have changed, but the actual binary
formats haven't.

so

int oh_here;
using (Stream s = new FileStream(@"c:\vb6lostdata.bin",
FileMode.Open)) {
while ((oh_here = s.ReadByte()) != -1) {Console.Write("'{0}'",
(char)oh_here);}}

wont work?

I tought all data in a file where binary data... silly me...
just had some problems with writing notepad 'åäö' and then reading
them in c#
//CY
 
C

christery

so

int oh_here;
using (Stream s = new FileStream(@"c:\vb6lostdata.bin",
FileMode.Open)) {
    while ((oh_here = s.ReadByte()) != -1) {Console.Write("'{0}'",
(char)oh_here);}}

wont work?

I tought all data in a file where binary data... silly me...
just had some problems with writing notepad 'åäö' and then reading
them in c#
//CY

Think he got chr$(12) from me... I dont have it ... I dont get it
either...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top