Sending data from a PHP script to a C# applicaiton

谁说胖子不能爱 提交于 2019-12-13 00:18:19

问题


When C# app is ran, it POSTS a request to the PHP server, which wants to return an array. What's an easy way to load this array's contents into C# for using with there.

For clarification, this array is a PHP stdClass object that contains strings, floats, and other stdClass objects. I want to get a similar data structure on the C# end with the same data.

Also, I know stdClass != arrays, but they're pretty simular so that they can be encoded the same way witn most encoding mechanisms.


回答1:


I don't know C# but JSON encoding using json_encode() is pretty popular in the web app world as a simple means to transfer simple structures across platforms.

There is a variety of parser classes on the C# end, scroll down in the first link.



来源:https://stackoverflow.com/questions/2709349/sending-data-from-a-php-script-to-a-c-sharp-applicaiton

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