开发者

Use JavaScriptSerializer to produce object with arbitrary property names

开发者 https://www.devze.com 2023-01-11 23:57 出处:网络
In .Net, I want to generate a json object as follows: {\"1\":true} Can I do so using JavaScriptSeri开发者_开发百科alizer?

In .Net, I want to generate a json object as follows:

{"1":true}

Can I do so using JavaScriptSeri开发者_开发百科alizer? Can I do it any other way?


ExpandoObject may solve what you want.

Allows to build object with dynamic properties but compatible only with .net 4

0

精彩评论

暂无评论...
验证码 换一张
取 消