How to save an object in file and load it

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi
I want to save object in file
Like I have a very simple example
<pre class="prettyprint lang-vb Class Rectangle
Public Size as Size
Public Position as Point
End Class[/code]
Now for code i want
<pre class="prettyprint Dim x as new rectangle
x.size=new point(100,100)
x.Position=new Point(10,10)
SaveObject("MyFile",x,0)
[/code]
And File should be in this form
<pre class="prettyprint Class:Rectangle:0{
Size={
Height=100
Width=100}
Position={
X=10
Y=10}}<br/>[/code]
In this statement
Class Tells us that the object was a class of name Rectangle and 0 is id of object
Readonly properties should not be written
Only writeable properties should be saved
And Next thing is to load object
<pre class="prettyprint lang-vb Dim R as Object
R=LoadObject("MyFile",0)[/code]
Please help me!
<
Do the Impossible

View the full article
 
Back
Top