|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How might one serialize a sorted dictionary?Private m_profilesDict As Dictionary(Of String, Object) = New Dictionary(Of String, Object) If m_profilesDict.ContainsKey(ProfileName) Then ProfileDict = m_profilesDict.Item(ProfileName) Else ProfileDict = New SortedDictionary(Of Double, String) m_profilesDict.Add(ProfileName, ProfileDict) End If If ProfileDict.ContainsKey(dlength) Then .... Else ProfileDict.Add(dlength, "to be determined") End If so at runtime i might have M_ProfileDict.Item ("A") ProfileDict.Item("25").Value = "1" ProfileDict.Item("36").Value = "2" ProfileDict.Item("45").Value = "3" M_ProfileDict.Item ("C") ProfileDict.Item("15").Value = "1" ProfileDict.Item("26").Value = "2" ProfileDict.Item("35").Value = "3" M_ProfileDict.Item ("D") ProfileDict.Item("27").Value = "1" ProfileDict.Item("39").Value = "2" ProfileDict.Item("41").Value = "3" what would be an easy way to store to file and read back from file in another session of the app? I didn't notice a SortedDictionary.Serialize(Filename) property on the object. Show quoteHide quote :-) thanks mark mp wrote:
> given a sorted dictionary of sorted dictionaries You can unload the data out of the dictionary creating an object of each > Private m_profilesDict As Dictionary(Of String, Object) = New Dictionary(Of > String, Object) > > what would be an easy way to store to file and read back from file in > another session of the app? > I didn't notice a SortedDictionary.Serialize(Filename) property on the > object. > :-) item and load the object into a List<T>. http://support.microsoft.com/kb/316730 Here is a C# example of how to serialize/deserialize a List<T> of objects to/from a file. I am sure you can find a VB.Net example use Google to find it. http://dotnetperls.com/serialize-list-tutorial Of course, the object has to be known by both programs. excellent! thanks for the links
mark Show quoteHide quote "Mr. Arnold" <Arn***@Arnold.com> wrote in message news:%23qaw1r7zKHA.4752@TK2MSFTNGP04.phx.gbl... > mp wrote: >> given a sorted dictionary of sorted dictionaries >> Private m_profilesDict As Dictionary(Of String, Object) = New >> Dictionary(Of String, Object) >> >> what would be an easy way to store to file and read back from file in >> another session of the app? >> I didn't notice a SortedDictionary.Serialize(Filename) property on the >> object. >> :-) > > You can unload the data out of the dictionary creating an object of each > item and load the object into a List<T>. > > http://support.microsoft.com/kb/316730 > > Here is a C# example of how to serialize/deserialize a List<T> of objects > to/from a file. I am sure you can find a VB.Net example use Google to find > it. > > http://dotnetperls.com/serialize-list-tutorial > > Of course, the object has to be known by both programs. >
container for tables & queries in VB.NET 2008
A solution! DateTimePicker Minimum and Maximum Values Ocx : how to read MajorVer, MinorVer and RevisionVer ? needs double value in string format help about initialize Drawing Curved Text Round(0.5) returns 0. RE: Downloading file without knowing the corrent filename External functions |
|||||||||||||||||||||||