Re: [2005] Saving this items
I don't know what you mean by saving them to a TextBox.
Re: [2005] Saving this items
sorry, i made a mistake i want to save them into a *TEXT FILE
Re: [2005] Saving this items
Do you have a specific format in mind for this file? If not I'd suggest using XML. You can serialise a collection of your objects to a file in about four lines of code, then deserialise the file back to a collection in the same. Search the forum for XmlSerializer and you should find examples.
Re: [2005] Saving this items
ive been searching the forum for xmlSerializer examples, but there no thread that can help me, i tried this code but nothing happends....:
to deserialize the file:
Vb .net Code:
Dim n As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim ss As New IO.FileStream("C:\Users\Pablo\Documents\set.bin", IO.FileMode.Open)
listoffavorites = CType(n.Deserialize(ss), Global.System.ComponentModel.BindingList(Of Favorites))
ss.Close()
to sereliaze the file
Vb .net Code:
Dim s As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim n As New IO.FileStream("C:\Users\Pablo\Documents\set.bin", IO.FileMode.Create)
s.Serialize(n, listoffavorites)
n.Close()
nothing happends while using this codes what i want to do its save all the favorites item that are currently in listoffavorites, and load them again at form load but i have no idea on how to do this, maybe its by xmlserializer but i dont know how to use this i searched in msdn but i found nothing, so i will really apreciate if someone help....thanxs
Re: [2005] Saving this items
Re: [2005] Saving this items
I just searched the VB.NET forum for xmlserializer and this was the second result, after this very thread. I'm guessing that's where you got that code from but at the end it has an example of using an XmlSerializer. You really didn't look very hard.