Git Product home page Git Product logo

Comments (5)

xyz347 avatar xyz347 commented on July 29, 2024

是所有的双引号都要反斜杠吗?能否给个例子

from x2struct.

CasonTsai avatar CasonTsai commented on July 29, 2024

这个是x2struct 生成的json字符串
{"aid":"1","cid":"1","cid_url":"11","time_stamp":"1","status":"1","time_stamp":"1","pic_name":"1","pic_data":"","data":[{"frame_id":"1","time_stamp":"1","alertFlag":"1","headInfo":[{"x":123,"y":123,"width":123,"height":123,"numOfHelmet":"1","color":"1"}]}]}

下面这个是asp.net前端那块需要的格式
{\"aid\":\"1\",\"cid\":\"1\",\"cid_url\":\"11\",\"time_stamp\":\"1\",\"status\":\"1\",\"time_stamp\":\"1\",\"pic_name\":\"1\",\"pic_data\":\"\",\"data\":[{\"frame_id\":\"1\",\"time_stamp\":\"1\",\"alertFlag\":\"1\",\"headInfo\":[{\"x\":123,\"y\":123,\"width\":123,\"height\":123,\"numOfHelmet\":\"1\",\"color\":\"1\"}]}]}

from x2struct.

CasonTsai avatar CasonTsai commented on July 29, 2024

我好像找到了,可能要从rapidjson那里改,我试下,如果可以告诉您

from x2struct.

xyz347 avatar xyz347 commented on July 29, 2024

你试一下调用两次tojson,第一次把结构体转字符串,把转出来的字符串再tojson一次

from x2struct.

CasonTsai avatar CasonTsai commented on July 29, 2024

两种方法都可以哈哈,谢谢大佬

from x2struct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.