PC Review


Reply
Thread Tools Rate Thread

how to deserialize an array?

 
 
Messer
Guest
Posts: n/a
 
      27th Mar 2005
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



 
Reply With Quote
 
 
 
 
Ray Cassick \(Home\)
Guest
Posts: n/a
 
      27th Mar 2005
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.


"Messer" <(E-Mail Removed)> wrote in message
news:d26o8k$il8$(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Messer
Guest
Posts: n/a
 
      27th Mar 2005
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?


 
Reply With Quote
 
Ray Cassick \(Home\)
Guest
Posts: n/a
 
      27th Mar 2005
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...



"Messer" <(E-Mail Removed)> wrote in message
news:d26sdg$9ed$(E-Mail Removed)...
> 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?
>
>



 
Reply With Quote
 
Messer
Guest
Posts: n/a
 
      28th Mar 2005
Uytkownik "Ray Cassick (Home)" <(E-Mail Removed)> 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



 
Reply With Quote
 
Ray Cassick
Guest
Posts: n/a
 
      28th Mar 2005
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.



"Messer" <(E-Mail Removed)> wrote in message
news:d28f99$65s$(E-Mail Removed)...
> Uytkownik "Ray Cassick (Home)" <(E-Mail Removed)> 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
>
>
>



 
Reply With Quote
 
Messer
Guest
Posts: n/a
 
      28th Mar 2005
Uzytkownik "Ray Cassick" <(E-Mail Removed)> napisal:

> Sorry, I can't offer much more since I am not knowledgeable in PHP at all.


ok ray. thank you for your response. i appreciate it.
greets,
messer


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Deserialize an XML Family Tree Mike Microsoft C# .NET 0 2nd Nov 2009 10:02 PM
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R Microsoft Excel Programming 3 13th Nov 2007 04:08 PM
Deserialize XML where XML may contain XML nick_nw Microsoft C# .NET 1 5th Jul 2006 11:32 AM
XML deserialize Stream works ok but deserialize from XmlNodeReader fails Samuel R. Neff Microsoft VB .NET 4 8th Feb 2005 03:37 AM
XML Deserialize Mullin Yu Microsoft C# .NET 1 17th Nov 2003 12:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:38 PM.