How to unserialize PHP Serialized array/variable/class and return suitable object in C#

萝らか妹 提交于 2019-11-26 06:08:34

问题


The goal is to unserialize a PHP serialized string and get sutable object in C#

Is there any way to make this possible in C#(.Net)?

To be more specific: We need to make an application which comunicates (Via HTTP) to specific website which returns the needed information. Fortunately/unfortunately we dont have permission to website so the data (array mostly) that is returned from website is PHP serialized.


回答1:


Found solution: Sharp Serialization Library




回答2:


I suppose using JSON as an intermediary step could be useful.




回答3:


You should probably write it to XML or JSON. You can construct your C# object back from the XML

Edit: Looks like there is already a XML serializer for PHP



来源:https://stackoverflow.com/questions/1914585/how-to-unserialize-php-serialized-array-variable-class-and-return-suitable-objec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!