|
-
Jan 7th, 2004, 10:36 AM
#1
Thread Starter
Addicted Member
Do I have to use serialization just to dump a structure to a file?
Do I have to use serialization just to dump a structure to a file? I hope this is not the case. I hope I can work it out like in VB6...
VB6 example:
VB Code:
Type TEST
test1 As Long
test2 As Integer
End Type
Sub Save
Dim a As TEST
Open "C:\test.bin" For Binary Access Write As 1
Put #1, a
Close 1
End Sub
is there a way to do exatcly the same thing in VB.NET WITHOUT using serialization?
btw, I know how to use serialization so please don't give me any examples on that...
-
Jan 7th, 2004, 10:48 AM
#2
PowerPoster
I don't know of another way.
What is the problem with serialization anyway?
-
Jan 7th, 2004, 11:24 AM
#3
Thread Starter
Addicted Member
there must be some way to be able to just drop a structure to a file.
the problem with serialization is that i don't have the control. i can't decide where to put the information and a lot of unnessecary information is also being stored.
when using vb6 i can put a structure wherever i want in a file. maybe there is a way to do that using serialization, i don't know.
-
Jan 7th, 2004, 11:47 AM
#4
You can implement ISerializable in your object to have more control over the serialization process. Its funny that you don't like serialization considering its less code and easier to work with. Alternatively there may be some methods of file access like you want in the Visual Basic Compatiblity namespaces or IO namespace.
-
Jan 7th, 2004, 01:01 PM
#5
Thread Starter
Addicted Member
it's not that i don't like serialization because i do. it's just that now it didn't 100% fit my needs.
can you give me an example of implementing the ISerializable and using it.
thanks.
-
Jan 7th, 2004, 02:00 PM
#6
Originally posted by danielkw
it's not that i don't like serialization because i do. it's just that now it didn't 100% fit my needs.
can you give me an example of implementing the ISerializable and using it.
thanks.
I cannot, I haven't tried implementing it before but there shoudl be an example in the help files.
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
|