在命令窗口中测试 ,所有的msgbox都可以正常弹出,并且每次弹出的msgbox("_identify")也在增长,但为什么就是无法保存呢? 百思不得其解
Dim str_accesstoken As String="23_o8m55dxZL_tH2XgBNJ2elFv18BWbZ345ezdl81gZ0gBjodIZ0Dt7wM9-UXMZXoMeMvUIqK9GYU68nUNFk0n-hEFUQVEgWGwdtvgVPWLV14-DyYSNU158uwsM5qqD8JqLo3m77ipctQXRbAHAAHB"
Dim hc As new HttpClient("https://api.weixin.qq.com/cgi-bin/user/get?access_token=" & str_accesstoken & "&next_openid=ojT5kwMGMRHO4tJ-nSiKuUzA_Pfk")
'Dim jo As New JObject = JObject.Parse(hc.GetData)
Dim jo As JObject = JObject.Parse(hc.GetData)
'msgbox(jo("total"))
'msgbox(jo("count"))
'msgbox(jo("data")("openid").ToString)
For Each v As JToken In JArray.Parse(jo("data")("openid").ToString)
' msgbox(v)
Dim hc1 As new HttpClient("https://api.weixin.qq.com/cgi-bin/user/info?access_token=" & str_accesstoken & "&openid=" & v.ToString)
Dim jo1 As JObject = JObject.Parse(hc1.GetData)
'msgbox(jo1("subscribe"))
msgbox(jo1("openid"))
'msgbox(jo1("nickname"))
Dim dr As DataRow = DataTables("WeChatUsers").SQLFind("openid='" & jo1("openid").ToString & "'")
If dr IsNot Nothing Then
' msgbox(dr("SubscribeTime"))
msgbox("有")
Else
msgbox("无")
Dim dr_new As DataRow = DataTables("WeChatUsers").AddNew()
msgbox(dr_new("_identify"))
dr_new("subscribeState")=jo1("subscribe")
dr_new("openid")=jo1("openid")
dr_new("nickname")=jo1("nickname")
dr_new("sex")=jo1("sex")
dr_new("language")=jo1("language")
dr_new("city")=jo1("city")
dr_new("province")=jo1("province")
dr_new("country")=jo1("country")
dr_new("headimgurl")=jo1("headimgurl")
' dr_new("SubscribeTime")=CCDate(jo1("subscribe_time").ToString)
dr_new("RemarkName")=jo1("remark")
dr_new("groupid")=jo1("groupid")
'dr_new.Save
DataTables("WeChatUsers").Save
msgbox("保存完毕")
'jo1("tagid_list") 这几个值表中没有
'jo1("subscribe_scene")
'jo1("qr_scene")
'jo1("qr_scene_str")
End If
Next