Y
Y
Yuri Denisov2014-08-12 10:53:02
C++ / C#
Yuri Denisov, 2014-08-12 10:53:02

What is the deserialization error in c#?

Good afternoon! There is this piece of code

Hashtable ht = (Hashtable)this.serializer.Deserialize(this.labelServices.Text);
labelServices.Text = (string)ht["0".ToString()];

The PHP Serializer library is connected, in the old project it works great with the same piece, but here it gives an error that it cannot cast the ArrayList object type to Hastable.
Here is such a simple array a:2:{i:0;s:1:"1";i:1;s:1:"2";}
. The most interesting thing is that the utility that is included in the library by default cannot also deserialize it with the same problem. Can anyone suggest a solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Denisov, 2014-08-13
@denissov

The problem is solved, it was necessary to do deserialization in ArrayList at once and that's it, do not use HashTable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question