|
-
May 3rd, 2002, 03:26 PM
#1
Thread Starter
New Member
.net has random files?
I all!
I wonder how can I translate the following, simply, code to Vb.NET (and/or
C#), possibly using just the .NET framework functions instead of the Visual
Basic Run-Time Functions (e.g. FileOpen) implemented only for compatibility:
Type MyType2
Values(10) as byte
End Type
Type MyType
Dt As Date
Typs(10) As MyType2
End type
Dim x() As MyType
Redim x(0 to 50)
' write a whole file
Open "dummy.dat" For Binary As 1
Put 1, 1, x()
Close 1
' update the #10 item
Open "dummy.dat" For Binary As 1
Put 1, 10, x(9)
Close 1
And then read the values:
' read the whole file...
Open "dummy.dat" For Binary As 1
Put 1, 1, x()
Close 1
' ...or just one element
Open "dummy.dat" For Binary As 1
Put 1, 10, x(9)
Close 1
I would not think that .NET has no structured binary/random-file
capability!
And if it is... how can I obtain something similar (I need speed accessing
disk and I don't want DB-engines)?
Thank you!
-
May 5th, 2002, 04:18 PM
#2
Frenzied Member
Use the FileSystem namespace. That ought to provide you with everything you need.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|