在计划管理里面,设置每隔一分钟执行下面代码,获取数据时,前面一段时间是可以正常获取数据的,但是过段时间后就会提示如下错误:
.NET Framework 版本:2.0.50727.8825
Foxtable 版本:2018.8.30.1
错误所在事件:
详细错误信息:
尝试自动重定向的次数太多。
Error reading JObject from JsonReader. Path '', line 0, position 0.
执行代码如下:
For Each r As Row In Tables("彩piao数据").Rows
'22点--0点
If #22:00# < Format(Date.Now, "t") And Format(Date.Now, "t") < #23:59#
If r("开始时间")< Format(Date.Now.AddMinutes(-5) , "t") And Format(Date.Now.AddMinutes(-5) , "t") < r("结束时间") Then
If r("开奖结果_个位") = Nothing Then
Dim hc As New HttpClient("http://wxcsxy.com//plans/cqssc.php")
Dim jo As JObject = Jobject.Parse(hc.GetData)
If jo("result")("data") IsNot Nothing Then
Dim ja As JArray = jo("result")("data")
Dim hm As String = ja(0)("preDrawCode").ToString
Dim cpqh As String = ja(0)("preDrawIssue").ToString
Dim Parts() As String = hm.Split(",")
If r("期号") = cpqh Then
r("开奖结果_万位") = CInt( Parts(0))
r("开奖结果_千位") = CInt(Parts(1))
r("开奖结果_百位") = CInt(Parts(2))
r("开奖结果_十位") = CInt(Parts(3))
r("开奖结果_个位") = CInt(Parts(4))
End If
End If
End If
End If
End If
next