.NET Framework 版本:2.0.50727.8800
Foxtable 版本:2019.4.12.1
错误所在事件:自定义函数WLCX
详细错误信息:
调用的目标发生了异常。
Error reading JObject from JsonReader. Path '', line 0, position 0.
Dim wl,wlxx As String
Dim AppCode As String = Functions.Execute("Get",68) '获取阿里云全国物流快递查询系统的AppCode
Dim dh As String = args(0)
If dh > "" Then
'获取物流信息
Dim url As String = "http://ali-deliver.showapi.com/showapi_expInfo?com=auto&nu={0}&senderPhone=8448"
Dim hc As New HttpClient(CExp(url,dh))
hc.Timeout = 5 '设置超时为5秒
hc.Headers.Add("Authorization","APPCODE " & AppCode)
Dim jo As JObject = Jobject.Parse(hc.GetData)
If jo("showapi_res_body")("data") IsNot Nothing Then
wlxx = ""
For Each jt As JToken In jo("showapi_res_body")("data")
If wlxx > "" Then
wlxx = wlxx & vbcrlf & jt("time").ToString & " | " & jt("context").ToString
Else
wlxx = jt("time").ToString & " | " & jt("context").ToString
End If
Next
End If
If wlxx Is Nothing Then
wlxx = "无查询记录"
End If
Return wlxx
Else
Return Nothing
End If