{"id":4209,"date":"2016-09-09T16:44:33","date_gmt":"2016-09-09T08:44:33","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4209"},"modified":"2016-09-09T16:45:26","modified_gmt":"2016-09-09T08:45:26","slug":"qjson%e4%b8%ad%e6%8a%8ajson%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%8c%e5%bd%93%e5%81%9a%e5%ad%90%e8%8a%82%e7%82%b9%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4209","title":{"rendered":"Qjson\u4e2d\u628ajson\u5b57\u7b26\u4e32\uff0c\u5f53\u505a\u5b50\u8282\u70b9\u7684\u65b9\u6cd5"},"content":{"rendered":"<h3><span style=\"color: #ff0000\"><strong>\u6211\u4e00\u76f4\u90fd\u5728\u5bfb\u627e\u5404\u79cd\u4e1a\u52a1\u529f\u80fd\u7684\u6700\u7b80\u5355\u5199\u6cd5\uff0c\u7528\u51cf\u6cd5\u7684\u6a21\u5f0f\u6765\u5f00\u53d1\u8f6f\u4ef6\u3002\u5982\u679c\u6709\u6bd4\u6211\u7684\u5199\u6cd5\u66f4\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u8bf7\u7559\u8a00\u544a\u77e5\u3002<\/strong><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/img.alicdn.com\/imgextra\/i1\/41670659\/TB2tU_Maqe5V1BjSspkXXcoqpXa-41670659.gif\" width=\"398\" height=\"402\" \/><\/p>\n<pre class=\"lang:delphi decode:true \">\r\nprocedure TForm4.btn2Click(Sender: TObject);\r\nconst\r\n  \/\/\u5916\u90e8\u7684\u4e00\u4e2aJson\u505a\u5b50\u8282\u70b9\r\n  AJsonStr = '{\"name\":\"\u5965\u5df4\u9a6c\",\"age\":18}';\r\nvar\r\n  MyQj: TQJson;\r\nbegin\r\n  MyQj := TQJson.Create;\r\n  try\r\n    MyQj.Add('country', '\u7f8e\u56fd');\r\n    MyQj.Add('address', '\u534e\u76db\u987f');\r\n\r\n\r\n    \/\/\u7f8e\u56fd\u6709\u5f88\u591a\u4eba\uff0c\u5965\u5df4\u9a6c\u662f\u5176\u4e2d\u4e00\u5458\uff0c\u800c\u5965\u5df4\u9a6c\u7684\u4fe1\u606f\u53ef\u80fd\u6765\u81ea\u4e00\u4e2aJson\u5b57\u7b26\u4e32\uff0c\r\n    \/\/\u6211\u4eec\u9700\u8981\u628a\u8fd9\u4e2aJson\u5b57\u7b26\u4e32\u5f53\u505a\u4e00\u4e2a\u5b50\u8282\u70b9\u63d2\u5165\u8fdb\u6765.\r\n    with MyQj.AddArray('person') do\r\n    begin\r\n      Add.AsObject := AJsonStr;\r\n    end;\r\n\r\n\r\n    Memo1.Lines.Clear;\r\n    Memo1.Lines.Add(MyQj.AsJson);\r\n  finally\r\n    MyQj.Free;\r\n  end;\r\nend;\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4e00\u76f4\u90fd\u5728\u5bfb\u627e\u5404\u79cd\u4e1a\u52a1\u529f\u80fd\u7684\u6700\u7b80\u5355\u5199\u6cd5\uff0c [&hellip;]<\/p>\n","protected":false},"author":117,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8,9,7,603],"tags":[],"class_list":["post-4209","post","type-post","status-publish","format-standard","hentry","category-delphi","category-qdac","category-qjson","category-603"],"views":9845,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/117"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4209"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4209\/revisions"}],"predecessor-version":[{"id":4213,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4209\/revisions\/4213"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}