以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]关于josn解析 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=193201) |
-- 作者:zto001 -- 发布时间:2024/8/26 11:15:00 -- [求助]关于josn解析 {"content":"76414989517298\\r\\n78440201872821\\r\\n76414989517298\\r\\n76415372357785\\r\\n76412299689841登记拦截","final_from_name":"测试名","final_from_wxid":"wxid_62q7me1l6ken12","from_name":"红星中通61-售后群翊邮-仙鸾-风柳-朱","from_wxid":"53284710703@chatroom","is_pc":0,"msg_type":1,"msgid":"8904268467146888670","original_content":"37363431343938393531373239380A37383434303230313837323832310A37363431343938393531373239380A37363431353337323335373738350A3736343132323939363839383431E799BBE8AEB0E68BA6E688AA","robot_wxid":"wxid_ap0qjgxd6j8122","timestamp":1724426837,"to_name":"立秋","to_wxid":"wxid_ap0qjgxd6j8122"} 上面这段josn,我只解析出76414989517298这个,后面的都没有解析出来,我这是什么原因?而且多行json只解析了前面14行,在15行直接出错 Dim s As String = FileSys.ReadAllText("C:\\Users\\admin\\Desktop\\微信机器人\\定制版接收文本.txt", Encoding.Default) \'Output.Show(s) Dim Values() As String Values = s.split(Chr(13) & Chr(10)) For Index As Integer = 0 To Values.Length - 1 Dim json As String = Values(Index) Dim jo As JObject = JObject.Parse(json) Output.Show(jo("content")) Next |
-- 作者:有点蓝 -- 发布时间:2024/8/26 11:32:00 -- Dim s As String = FileSys.ReadAllText("D:\\问题\\1.txt") \'Output.Show(s) Dim jo As JObject = JObject.Parse(s) \' Output.Show(jo("content").ToString) For Each a As String In jo("content").ToString.Replace(vbcr, "").Split(vblf) Output.Show(a) Next
|
-- 作者:zto001 -- 发布时间:2024/8/26 16:49:00 -- .NET Framework 版本:4.0.30319.42000 Foxtable 版本:2024.8.21.1 错误所在事件:窗口,微信信息记录,记录,Click 详细错误信息: After parsing a value an unexpected character was encountered: t. Path \'to_name\', line 2, position 365. 这是啥意思?每次读取到接近两千行的时候就报错
|
-- 作者:有点蓝 -- 发布时间:2024/8/26 16:54:00 -- json数据自己的问题,比如应该使用双引号的,用成了单引号 |
-- 作者:zto001 -- 发布时间:2024/8/26 18:04:00 -- 最后一行是空的,怎么剔除? |
-- 作者:有点蓝 -- 发布时间:2024/8/26 20:25:00 -- s = s.trim(vbcr,vblf," ") |