Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Serialization problem

5 views
Skip to first unread message

Eric

unread,
May 27, 2010, 4:03:49 PM5/27/10
to
Here is my code bytheway:

Website (rc is a structure):
Try
Dim fs As New FileStream(RapportName, FileMode.Create)
Dim bf As New BinaryFormatter

bf.Serialize(fs, rc)
fs.Flush()
fs.Close()
Catch ex As Exception
ClientScript.RegisterStartupScript(Me.GetType(), "alert",
"<script>alert('Error');</script>")
End Try

Application (rm is the same structure):

Dim fs As New FileStream(filenaam, FileMode.Open)
Dim bf As New BinaryFormatter

Dim rm As New RecordMonet
rm = CType(bf.Deserialize(fs), RecordMonet)
fs.Close()

fs = Nothing
bf = Nothing

...

<Serializable()> Public Structure RecordMonet
Public sOperator1 As String
Public sSitenummer1 As String
Public sOperator2 As String
Public sSitenummer2 As String
Public sOperator3 As String
Public sSitenummer3 As String
Public DatumInventarisatie As Date
Public sPartij As String
Public sPersoon As String
Public sFunctie As String

Public Items As Data.DataSet
Public fotos As Data.DataSet

Public sEmailZender As String
Public sEmailOntvanger As String

Public name As String
End Structure

"Eric" wrote:

> Hi,
>
> I was under the impression that with serialization I could transfer a block
> of data from one application to another.
> So I wrote a website where after the user had put in some data, it is put in
> a structure and that structure is serialized into a file.
>
> Then this file is emailed and the backend user reads it in an application
> for processing.
>
> If I try to read the file into the same kind of structure, I get an
> exception error.
> Apparently it needs the webpage that generated the file to open it???
>
> This is putting me in a lot of trouble as the website is already in use.
>
> Is there a way to read the data from the files without the assembly that
> created it?
>
> Please help me with this!!
>
> rg,
> Eric
>
>

Eric

unread,
May 27, 2010, 4:57:41 PM5/27/10
to
0 new messages