1

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
  • Define returns an array. A web server usually returns string contents. How is this array encoded? Are you using some specific protocol? Commented Apr 25, 2010 at 18:29
  • @Darin - I have a stdClass object as described in the ammended question. The question is how do I encode this array so that C# can decode it. Commented Apr 26, 2010 at 7:13

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

May I suggest looking at msdn.microsoft.com/en-us/library/…
Thanks. I ended up going with LINQ to JSON ( james.newtonking.com/projects/json-net.aspx ) for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.