以下代码中,企业号的CorpID 和 管理组的Secret 在企业微信中应该替换为什么?
Static CreateTime As Date '记录最近一次生成access_token的时间
Static AccessTocken As String '记录最近一次生成的access_token
Dim CorpID As String= "ww7deed3af842576ed" '企业号的CorpID
Dim Secret As String = "sO7RjwoisX82kB_gcRY4isEU8ZC6sJVcGs6CDlz8Nkc" '管理组的Secret
Dim tp As TimeSpan = Date.Now - CreateTime
If tp.TotalSeconds > 3600 Then
Dim url As String = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={0}&corpsecret={1}"
Dim hc As New HttpClient(CExp(url, CorpID, Secret))
Dim ret As String = hc.GetData()
If ret = "" Then '如果失败,再尝试一次
hc.GetData()
End If
CreateTime = Date.Now()
Dim jo As JObject = JObject.Parse(ret)
If jo("access_token") IsNot Nothing Then
AccessTocken = jo("access_token")
Else
MessageBox.show("获取access_token失败,原因:" & vbcrlf & jo.ToString)
End If
End If
Return AccessTocken
企业号的CorpID 和 管理组的Secret