asp源码微信公众号获取用户基本信息(PC端)

blic Function Get_Access_Token()
sCode = Request("code")
If sCode ="" And Session("access_token")="" Then
Response.Redirect(GetAuthorization_Code)
Else
If DateDiff("s",Now,Session("access_token_expires"))> 0 Then
Exit Function
End If
End If
Dim url, params,Temp
Url="https://api.weixin.qq.com/sns/oauth2/access_token?"
params = "appid="&s_APPID
params = params & "&secret=" & s_APPSECRET
params = params & "&code=" & sCode
params = params & "&grant_type=authorization_code"
url = Url & params
Temp=RequestUrl(url,"GET","")
‘Die Temp
If CheckData(Temp,"access_token") = True Then
set obj = getjson(Temp)
if isobject(obj) Then
Session("access_token") = obj.access_token
Session("access_token_expires") = DateAdd("s",obj.expires_in,Now)
Session("openid") = obj.openid
End If
set obj = Nothing
Else
Response.Write("Get_Access_Token()=>"&Temp)
Response.End()
End If
End Function

 

=============================================

互相学习电话微信:18611436777(加微信注明事由)

asp源码微信公众号获取用户基本信息(PC端)

 

asp源码微信公众号获取用户基本信息(PC端)

上一篇:获取微信公众号access_token源码asp写的源码


下一篇:C++ priority_queue 优先队列