2 create WeiXinOauth2Token class. This class has the following properties: (add get, set methods yourself)
Private string accessToken
Private int expiresIn
Private string refeshToken
Private string openId
Private string range;
3 Call the authorization interface of WeChat
/connect/oauth2/authorize? Appid = appid & redirect uri&; Code & scope = snsapi _ base & state = state # wechat _ redirect.
4 and then encode redirect_uri.
5 get the user openid
/u 011160656/articles/details /4 18475 17