views:

53

answers:

2

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.

+2  A: 

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.

Pekka
May I suggest looking at http://msdn.microsoft.com/en-us/library/bb299886.aspx#intro_to_json_topic5
Salman A
Thanks. I ended up going with LINQ to JSON ( http://james.newtonking.com/projects/json-net.aspx ) for it.
MiffTheFox
A: 

use soap webservices or a rest api

Tim Mahy