以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 这样的数组怎么解析啊 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=180991) |
-- 作者:aidimeng -- 发布时间:2022/10/21 11:52:00 -- 这样的数组怎么解析啊 { "n_a_s": 1, "atts": [ { "id": null, "reference": "1", "subReference": "1", "category": 0, "type": 0, "filename": "1.pdf", "mimeType": "application/octet-stream", "createdate": "2022-10-21 11:51", "size": "453178", "description": null, "fileUrl": "9065831156402834398", "extension": "pdf", "icon": "pdf.gif", "iconFont": "pdf", "genesisId": null, "sort": 0, "officeTransformEnable": "disable", "obsObjectKey": "", "secretLevel": null, "secretLevelName": null, "canBrowse": 1, "v": "8e2f4840f0b8b07c983aeff6d751cabb", "allowTrans": true, "transValue": { "isWpsOnlineEnable": false, "isAllowTrans": true }, "wpsOnlineEnable": false, "new": true, "extraMap": {} } ] } |
-- 作者:有点蓝 -- 发布时间:2022/10/21 11:57:00 -- http://www.foxtable.com/mobilehelp/topics/0140.htm Dim json As String = "{""n_a_s"".......... Dim jo As JObject = JObject.Parse(json) msgbox(jo("n_a_s").tostring) Dim ja As JArray = jo("atts") For i As Integer = 0 To ja.Count - 1 Output.Show(ja(i)("filename").ToString) Next
|
-- 作者:aidimeng -- 发布时间:2022/10/21 12:25:00 -- 牛叉 |
-- 作者:aidimeng -- 发布时间:2022/10/21 13:12:00 --
[此贴子已经被作者于2022/10/21 13:17:32编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/10/21 13:38:00 -- http://www.foxtable.com/mobilehelp/topics/0167.htm,学学里面生成json数组的用法 |
-- 作者:aidimeng -- 发布时间:2022/11/1 11:11:00 -- "formsonxx2":[ { "商品名称":"键盘", "实际单价":21, "到货时间":"2018-06-19" “物品图片”:附件类型--一个数组 }, { "商品名称":"键盘", "实际单价":30, "到货时间":"2018-06-19" “物品图片”:附件类型--一个数组 }], 想实现上面 数组下包含 数组的形式 Dim ja2 As New JArray jo("data")("data")("formson_3709") = ja2 ja2.add(New JObject) ja2(0)("事实描述") = "12312312231" Dim ja As New JArray jo("data")("data")("formson_3709")("field3") = ja ja(0)("fileUrl") = fileurl 这样提交总是报错 |
-- 作者:有点蓝 -- 发布时间:2022/11/1 11:18:00 -- jo("data")("data")("formson_3709")("field3") = ja ja.add(New JObject) ja(0)("fileUrl") = fileurl
|
-- 作者:aidimeng -- 发布时间:2022/11/1 11:23:00 -- 此主题相关图片如下:微信截图_20221101112214.png 有报错
|
-- 作者:有点蓝 -- 发布时间:2022/11/1 11:29:00 -- 完整代码 |
-- 作者:aidimeng -- 发布时间:2022/11/1 12:03:00 -- Dim hc As New HttpClient("http://10.32.195.238:90/seeyon/rest/bpm/process/start") Dim xxtoken As String = Functions.Execute("token").ToString hc.Headers.Add("token", xxtoken) Dim fileurl As Long = Functions.Execute("upload") Dim url As String = "http://10.32.195.238:90/seeyon/rest/bpm/process/start" Dim jo As New JObject jo("appName") = "collaboration" \'固定值 jo("transfertype") = "json" jo("data") = New jobject jo("data")("templateCode") = "H00002" \'流程编号 jo("data")("draft") = "1" \'1草稿 0 发送 Dim ja1 As New JArray jo("data")("attachments") = ja1 ja1.Add(fileurl) jo("data")("data") = New jobject jo("data")("data")("formmain_3708") = New JObject \'formmain_0247 流程数据表名 jo("data")("data")("formmain_3708")("发起人") = "哈哈哈" \'jo("data")("data")("formmain_3709")("用工类型") = "合同工" \'//附件数组 Dim ja2 As New JArray jo("data")("data")("formson_3709") = ja2 ja2.add(New JObject) ja2(0)("事实描述") = "12312312231" Dim ja As New JArray jo("data")("data")("formson_3709")("field3") = ja ja.add(New JObject) ja(0)("fileUrl") = fileurl hc.C hc.Content = jo.ToString Dim ret As String = hc.GetData() Dim jo1 As JObject = JObject.Parse(ret) Output.Show(jo.ToString)
[此贴子已经被作者于2022/11/1 12:11:41编辑过]
|