以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- json生成的问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=106508) |
-- 作者:rjh4078 -- 发布时间:2017/9/10 19:31:00 -- json生成的问题 With Tables("销售订单") If .current IsNot Nothing Then Dim jo As New JObject jo("@number") =.current("订单号") jo("quantity") =.current("订单数量") jo("consignee") = .current("客户名称") jo("address") = .current("收货地址") jo("shipping-type")=.current("送货方式") Output.Show(jo.ToString) End If End With Dim jo As New JObject jo("@number") ="" jo("quantity") = "" jo("consignee") = "" jo("address") = "" jo("shipping-type")="" Output.Show(jo.ToString) 红色部分能正常运行,但是用上面的就报错 --------------------------- 版本:2017.8.19.1 --------------------------- 代码执行出错,错误信息: System.InvalidCastException: 无法将类型为“System.String”的对象强制转换为类型“Newtonsoft.Json.Linq.JToken”。 在 UserCode.Test() --------------------------- 确定 --------------------------- |
-- 作者:rjh4078 -- 发布时间:2017/9/10 20:20:00 -- 我发现这样的代码都没法执行 jo("process")("press")=iif(dr("印刷否"),"yes","no")
|
-- 作者:rjh4078 -- 发布时间:2017/9/10 20:27:00 -- Dim xo As New XObject xo("name") = "李云龙" xo("age") = "36" xo("card") = New JObject xo("card")("bank") = "工行" xo("card")("account") = "12345678" Output.Show(xo.ToXML) 显示的结果为: <xml><name>李云龙</name><age>36</age><card><bank>工行</bank><account>12345678</account></card></xml> 这里的根目录<xml>如何换成自定义的?
[此贴子已经被作者于2017/9/10 20:33:22编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/9/10 20:35:00 -- 1、比如
jo("@number") = cstr(.current("消费时间"))
2、比如
Dim str As String = "<?xml version=""1.0"" encoding=""UTF-8"" standal?>" |
-- 作者:rjh4078 -- 发布时间:2017/9/10 20:49:00 -- Dim dlg As OpenFileDialog dlg.InitialDirectory="c:\\" 这段代码为什么会报错?
|
-- 作者:有点甜 -- 发布时间:2017/9/10 20:58:00 -- Dim dlg As New OpenFileDialog |