A
Amsteel
I got something like this in VB.Net
<Serializable()> Public Class YQProfileC
Inherits CollectionBase
Public Sub Save2File(ByVal FileName As String)
Dim IFormatter As New BinaryFormatter()
Dim FS As FileStream = New FileStream(FileName, FileMode.Create,
FileAccess.Write, FileShare.None)
IFormatter.Serialize(FS, Me)
FS.Close()
End Sub
Public Function LoadFromFile(ByVal FileName As String) As YQProfileC
Dim IFormatter As New BinaryFormatter()
Dim FS As FileStream = New FileStream(FileName, FileMode.Open,
FileAccess.Read, FileShare.None)
Return IFormatter.Deserialize(FS)
End Function
End Class
Now I got two problem here:
1.For some reason, the Root space name of the project needs to be changed
from YQV020 to YQV. But after that, how could I deserialize the old file.
2.What would have been done to deserialize the file if we want o change the
code from VB.net to C#.net? Please don't ask me why.
Thanks very much.
Amsteel
<Serializable()> Public Class YQProfileC
Inherits CollectionBase
Public Sub Save2File(ByVal FileName As String)
Dim IFormatter As New BinaryFormatter()
Dim FS As FileStream = New FileStream(FileName, FileMode.Create,
FileAccess.Write, FileShare.None)
IFormatter.Serialize(FS, Me)
FS.Close()
End Sub
Public Function LoadFromFile(ByVal FileName As String) As YQProfileC
Dim IFormatter As New BinaryFormatter()
Dim FS As FileStream = New FileStream(FileName, FileMode.Open,
FileAccess.Read, FileShare.None)
Return IFormatter.Deserialize(FS)
End Function
End Class
Now I got two problem here:
1.For some reason, the Root space name of the project needs to be changed
from YQV020 to YQV. But after that, how could I deserialize the old file.
2.What would have been done to deserialize the file if we want o change the
code from VB.net to C#.net? Please don't ask me why.
Thanks very much.
Amsteel