{
"memberRegistration": [{
"reference_mobile": "1",
"reference_name": "r1",
"member_id": "12"
}, {
"reference_mobile": "2",
"reference_name": "r2",
"member_id": "12"
}, {
"reference_mobile": "3",
"reference_name": "r3",
"member_id": "12"
}, {
"reference_mobile": "4",
"reference_name": "r4",
"member_id": "12"
}]
}
我有一个如上所示的json对象。如何将其转换为字符串?
我想要这种格式的字符串;
@"[{""reference_mobile"":""1"",""reference_name"":""r1"",""member_id"":""12""},"+@"{""reference_mobile"":""2"",""reference_name"":""r2"",""member_id"":""12""},"+@"{""reference_mobile"":""3"",""reference_name"":""r3"",""member_id"":""12""},"+@"{""reference_mobile"":""4"",""reference_name"":""r4"",""member_id"":""12""}]";
请帮我这样做。
答案 0 :(得分:1)
string json = new JavaScriptSerializer().Serialize(YourJson);