zoukankan      html  css  js  c++  java
  • JsonException: Max allowed object depth reached while trying to export from type System.Single

    在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type System.Single。

    ok,实际上是类的属性中有json不能识别的数据类型,我这里就脑残的float。去除掉之后就ok了。

    (备注:用的是LitJson)

    那一般什么类型是允许的呢?

    我在JsonData类中找到了答案。

    [csharp] view plaincopy在CODE上查看代码片派生到我的代码片
     
    1. public JsonData(bool boolean);  
    2. public JsonData(double number);  
    3. public JsonData(int number);  
    4. public JsonData(long number);  
    5. public JsonData(object obj);  
    6. public JsonData(string str);  
  • 相关阅读:
    第8周课下作业1(补)
    第八章课下测试
    POJ
    POJ
    HDU
    UVa
    UVa
    CodeForces
    ZOJ
    LightOJ
  • 原文地址:https://www.cnblogs.com/soundcode/p/4375873.html
Copyright © 2011-2022 走看看