ASP Wechat service number H5 Customer login , And to obtain the basic information of the user authorized by the customer is to need the authorization of the customer , Here are the detailed steps :

First step : Customers click on the login page , Automatically jump to wechat server to get code

The second step : With the first step code To get customers access_token、openid

The third step : Use what you just got access_token、openid To get basic customer information

The content of the above three steps is relatively simple , But writing code logic is all encapsulated in WeixinDLL, Let's go straight to the code .

The login page :login.asp

 1 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
2 <!DOCTYPE html>
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
7 <title> Customer wechat login </title>
8 </head>
9 <body>
10 <%
11 On Error Resume Next
12 Dim WxObj
13 Set WxObj = Server.CreateObject("WeixinDLL.WeixinClass")
14 WxObj.SetAppID = " Wechat service number AppID"
15 Dim RedirectUrl,CallUrl
16 CallUrl = "https://www.domain.com/login/call.asp" ' This is a jump back to our own server to receive customer data information page
17 RedirectUrl = WxObj.Get_RedirectUrl(CallUrl) ' This is to encapsulate the wechat bar login complex page into DLL It can be called directly in the
18 Response.Redirect(RedirectUrl) ' Jump to login authentication
19 Set WxObj = Nothing
20 If Err Then Response.Write Err.Description
21 %>
22 </body>
23 </html>

Page to receive customer information :call.asp

 1 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
2 <!DOCTYPE html>
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
7 <title> Customers authorize wechat personal information </title>
8 </head>
9 <body>
10 <%
11 'On Error Resume Next
12 Dim WxObj
13 Set WxObj = Server.CreateObject("WeixinDLL.WeixinClass")
14 WxObj.SetAppID = " Wechat service number AppID"
15 WxObj.SetAppSecret = " Wechat service number AppSecret"
16
17 Dim Code,TOJson,UserJson,uJson,TokenOpenID
18 Code = Trim(Request("code"))
19 TOJson = WxObj.Get_Token_OpenID(code)
20 If TOJson="" Then Response.Write " obtain access_token And openid Failure ":Response.End()
21
22 UserJson = WxObj.GetUserInfo(TOJson)
23 Set uJson = WxObj.parseJSON(UserJson)
24 Response.Write "openid=" & uJson.openid & "<br>"
25 Response.Write "nickname=" & uJson.nickname & "<br>"
26 Response.Write "headimgurl=" & uJson.headimgurl & "<br>"
27 Response.Write "country=" & uJson.country & "<br>"
28 Response.Write "province=" & uJson.province & "<br>"
29 Response.Write "city=" & uJson.city & "<br>"
30 'Response.Write "unionid=" & uJson.unionid & "<br>" ' The official account is bound to WeChat's open platform account , This field will appear
31
32 Set uJson = Nothing
33 Set WxObj = Nothing
34 'If Err Then Response.Write Err.Description
35 %>
36 </body>
37 </html>

Note the above customer authorized wechat service number H5 The login program uses WeixinDLL Components , If you need this component , You can contact me :z18670092211

ASP Wechat service number H5 Customer login , And get more related articles about the basic information of users authorized by customers

  1. PHP Development of community wechat service number

    This blog is about the wechat service number just launched at the beginning of this month , I want to summarize and share with you . At the end of last year , My team is talking about Developing Micro signals , This is the beginning of the conversation : There was one 3 Wechat registered years ago , But background operations can't be done from “ Subscription number ” Changed to: “ Service number ”, I'll find Tencent ...

  2. Push through wechat service number Zabbix The alarm

    Recently, I saw an article on wechat Zabbix Warning article , But in practice, we found that , Unable to send message successfully . The analysis reason , It should be that wechat public platform has strengthened login verification , When logging in, the administrator will need to scan the QR code to successfully log in to the background : And in the previous article A ...

  3. Wechat service number template message interface added &quot; Set up industry &quot; and &quot; Add the template &quot; And detail optimization

    Wechat service number template messages can send important service notifications to users , For example, credit card notice , Notification of successful purchase of goods, etc . Yesterday, , Wechat team announced that the template message was newly added “ Set up industry ” and “ Add the template ” Interface and detail optimization , The detailed changes are as follows Template message [ Business notification ] since ...

  4. $Django Alipay pay , Wechat service number push message ( Testing requires deploying the application to the server )

    One   Alipay pay Probably Alipay pay Formal environment : Need to use business license to apply for merchant number ,appid Test environment : Sandbox environment :https://openhome.alipay.com/platform/appDaily.ht ...

  5. Wechat service number redirect_uri Domain name is inconsistent with background configuration , Error code 10003

    Wechat service number development to obtain users openid It's always prompting redirect_uri Domain name is inconsistent with background configuration , Error code 10003: The domain name is also configured in the background reason : result : Got it openid

  6. Java Development of wechat service number ( Simple introduction )

    The steps of wechat service number development A project reference address that someone else has built : Download link 1. Build wechat service number server Project configuration maven <dependency> <groupId>com.soe ...

  7. WeChat official account development ( 3、 ... and ) obtain access_token

    WeChat official account development ( 3、 ... and ) obtain access_token 1. explain access_token The official account is the only global interface invoke credential. , Official account calls for interfaces. access_token. Developers need to keep it properly .acce ...

  8. WeChat official account H5 Pay for the potholes

    Brief history The official documents make it clear , The merchant has H5 Mall website , When the user opens the web page in wechat through message or scanning QR code , You can call wechat payment to complete the purchase process . Of course , Recently, wechat payment platform has also joined the pure H5 payment , That is to say, users can be outside of wechat ...

  9. JAVA Wechat service number Development Notes

    Now the development of wechat public platform has become more and more common , This development needs to use wechat public platform . So here's a simple record , It can also be regarded as some enlightenment for those children's shoes who have never stepped on the pit . I'll give a brief description in a few parts , I'll explain it in detail later . Basic authentication information description ...

  10. WeChat official account H5 payment

    Wechat payment instructions 1. Unified order interface Unified payment interface : url: https://api.mch.weixin.qq.com/pay/unifiedorder Purpose : Create advance payment orders through this interface , Getting the order payment requires ...

Random recommendation

  1. kettle take Excel Data import oracle

    Reading guide Excel Data import Oracle Database method : 1. Use PL SQL The features that come with the tool , Low efficiency Please refer to the introduction of this article :http://www.2cto.com/database/201212/17 ...

  2. FZU 1608 Huge Mission( Line segment tree )

    Problem 1608 Huge Mission Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Oaiei ...

  3. Use ngin Static file download

    1, Master profile nginx.xml #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error. ...

  4. Android Open source projects find ---ListView piece ( Continuous updating )

    Information reprint address :https://github.com/Trinea/android-open-project 1. android-pulltorefresh A powerful pull refresh open source project , Support all kinds of controls ...

  5. Android The user interface UI Components --AdapterView And its subclasses ( 5、 ... and ) Spinner and SpinnerAdapter

    Spinner It's a drop-down box component , You can customize the drop-down layout style , have access to ArrayAdapter as well as SpinnerAdapter adapter stay Adapter To realize SpinnerAdapter, Inherit BaseAdapte ...

  6. 2014 Multi-University Training Contest 1 - J Rating

    Topic link : pid=4870">http://acm.hdu.edu.cn/showproblem.php?pid=4870 The main idea of the topic : The question : One person signs up for two accounts , initial rating All are ...

  7. azure Continuous deployment on the Internet web

    Continuous deployment web   Continuous deployment web, It can be deployed the first time web After the application , Easy to modify and automatically submit code to deploy new versions of web application . Among them, automatic submission is used github Medium webhook, Make the code in master After you submit your changes on, you can ...

  8. Based on Quanzhi H3 Chip ARM Development environment construction

    Based on Quanzhi H3 Chip ARM Development environment construction Recently bought a friendly arm NanoPi M1 The board , I applied online for another NanoPi NEO The board , Both of them are based on Quanzhi H3 Chip Crotex-A7 Tetranuclear ARM Development board , Two boards can ...

  9. POJ 3140.Contestants Division Foundation tree dp

    Contestants Division Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 10704   Accepted:  ...

  10. understand call And apply

    Reprinted from :http://www.zhihu.com/question/20289071 //call and apply It's all about changing the runtime of a function context That is, context exists , let me put it another way , Just to change ...