|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to deserialize an array?hello,
is there a way to deserialize the array: a:2:{i:0;s:8:"element0";i:1;s:8:"element1";} in vb. net? greets, messer Take a look at this web site...
http://abstractvb.com/code.asp?F=1&P=2&A=1018 It has a great article on how to serialize and deserialize and object. They use a custom class but doing an array is no different. I use this exact same code to do hashtables and such. An array is no different. Also, you don't say if you want it to be deserialized form a file or a memory stream. That is no mater either since you can replace the filestream form the example to a memory stream and get the same effect. Show quoteHide quote "Messer" <inva***@email.com> wrote in message news:d26o8k$il8$1@nemesis.news.tpi.pl... > hello, > > is there a way to deserialize the array: > a:2:{i:0;s:8:"element0";i:1;s:8:"element1";} > in vb. net? > > greets, > messer > > > hello ray,
>Also, you don't say if you want it to be deserialized form a file or a i have this serialized array assigned to a variable "str" . (dim str as >memory stream. string). so i would like to deserialize it from the "str" into "tab_1" (dim tab_1(n) as string) is it still possible? :) The key is what method did you use to serialize it? Then you really just
have to reverse it. Post the code you used to get from the array to the string and we will see what we can do... Show quoteHide quote "Messer" <inva***@email.com> wrote in message news:d26sdg$9ed$1@nemesis.news.tpi.pl... > hello ray, > >>Also, you don't say if you want it to be deserialized form a file or a >>memory stream. > > i have this serialized array assigned to a variable "str" . (dim str as > string). > so i would like to deserialize it from the "str" into "tab_1" (dim > tab_1(n) as string) > > is it still possible? :) > > Uytkownik "Ray Cassick (Home)" <rcassickNOSPAM@enterprocity.com> napisal: the array is serialized with php method "serialize".> Post the code you used to get from the array to the string and we will see > what we can do... > The key is what method did you use to serialize it? Then you really just > have to reverse it. then i add a reference to that method from vb .net env. Dm m_abc As abc.pl.host.www dim str as string str=m_abc.users_list() and the string str has the value: a:2:{i:0;s:8:"element0";i:1;s:8:"element1";}. now i have to split this to a vb array and don't know how. greets, messer Hmmm I think you have me there. When you mentioned the term serialized I
figured you were talking like XML Serialization. The method you are talking about seems to be different. Looks like they refer to serialize as more of a linearization or flattening of the array into a string. You might be able to get away with writing a function that takes the string, reads through each of it's tokens and places them into your array. Sorry, I can't offer much more since I am not knowledgeable in PHP at all. Show quoteHide quote "Messer" <inva***@email.com> wrote in message news:d28f99$65s$1@nemesis.news.tpi.pl... > Uytkownik "Ray Cassick (Home)" <rcassickNOSPAM@enterprocity.com> napisal: > > Post the code you used to get from the array to the string and we will see > > what we can do... > > > The key is what method did you use to serialize it? Then you really just > > have to reverse it. > > the array is serialized with php method "serialize". > then i add a reference to that method from vb .net env. > > Dm m_abc As abc.pl.host.www > dim str as string > str=m_abc.users_list() > > and the string str has the value: > a:2:{i:0;s:8:"element0";i:1;s:8:"element1";}. > now i have to split this to a vb array and don't know how. > > greets, > messer > > > Uzytkownik "Ray Cassick" <rcassick@nospam.enterprocity.com> napisal: ok ray. thank you for your response. i appreciate it.> Sorry, I can't offer much more since I am not knowledgeable in PHP at all. greets, messer
Timer1_Elapsed problem.
Locate MessageBox over Window How can I get the Menuitem 's name ?? ListViewImageList keeps bitmap locked after disposing what if the database connection isn't close sqlreader Do...while problem MaskedEdit Control Friend WithEvents Upload file programmatically DataGrid OnPaint/? -How Do I Draw A GDI Type Circle On Top Of A DataGrid |
|||||||||||||||||||||||