Dim tb As Table = e.Form.Controls("table1").Table
tb.DataSource = DataTables("Materials")
Dim dr As DataRow = tb.DataTable.find("编号 = '" & bh & "' ")
If dr IsNot Nothing Then
Dim url As String = "https://api.weixin.qq.com/cgi-bin/material/del_material?access_token='{0}'&media_id='{1}'"
Dim med As String = dr("mediaID")
Dim hc As new HttpClient(CExp(url, Functions.Execute("GetAccessToken"),med))
Dim jo As JObject = JObject.Parse( hc.getdata)
If jo("errcode") = "0" Then
messagebox.show("微信服务器已删除")
Else
messagebox.show("微信返回错误:" & jo.ToString)
Return
End If
End if
返回错误:
{
"errcode": 40001,
"errmsg": "invalid credential, access_token is invalid or not latest hint: [4bdjjA0243vr29!]"
}
但:GetAccessToken没有问题呀,因为上传图片时能执行GetAccessToken