2010-03-24 48 views

回答

1

有一個JSONDataSerializer,但它是一些不起眼的裝配。 (也許是ASP.NET擴展?)

0
using System.Web.Script.Serialization; 

... 

JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); 

string payload = javaScriptSerializer.Serialize(myObject); 
//or 
string payload = javaScriptSerializer.Serialize(new object[] { myObject.Id });