程式碼:
1 [Test] 2 public void Test() 3 { 4 JsConfig.PropertyConvention = JsonPropertyConvention.Lenient; 5 var json ="{\"result\":\"0\",\"result_string\":\"成功\"}"; 6 var resp = json.FromJson<PayResp>(); 7 Console.WriteLine(resp.ResultString); 8 }
程式碼:
1 [Test] 2 public void Test() 3 { 4 JsConfig.PropertyConvention = JsonPropertyConvention.Lenient; 5 var json ="{\"result\":\"0\",\"result_string\":\"成功\"}"; 6 var resp = json.FromJson<PayResp>(); 7 Console.WriteLine(resp.ResultString); 8 }