Link to home
Start Free TrialLog in
Avatar of meetsys
meetsysFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Deserialisation in C#

Hi all,

I was wondering if anyone can please advise. Basically I'm using memcache. The idea is that a php systems serialises an object and puts it on the memcache. I then retrieve it in my C# project and de-serialises it.

I cant see any of the php side of it and should be just able to de-serialise it. The data I have is like this.

SESSION_STUFF|a:1:{i:-1;s:0:"";}

Apparently above is already serialised. So I need to get it into a memory stream and de-serialise as above.

Any advice would be really appreciated. This is one of the toughest tests I have faced.

Thanks in advance.
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand image

The problem is that you can serialise an object in many different ways, its not like there is one way to do it. Therefore you have to know how PHP serialises an object to be able to deserialise it.

However with a bit of a google search it appears someone has already solved the problem for you: http://sourceforge.net/projects/csphpserial/
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, meetsys.  I see you are new to Experts-Exchange.  The community standards incorporate the grading guidelines.  If you were unhappy with the answers, you're expected to engage in dialog with the Expert community to satisfy your issues.  If you were happy with the answers, the correct (and default) grade is "A."

http://support.experts-exchange.com/customer/portal/articles/481419

Please let us know if you didn't understand the answer or if we let you down in some way.  Thanks. ~Ray