91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: C#
  • 標簽: 微信.NET??

資源簡介

微信認證流程(我自己簡稱三次握手): 1、用戶同意授權,獲取code 2、通過code換取網頁授權access_token,用戶openId等信息 3、通過access_token和用戶的openId獲取該用戶的用戶信息 因為第一步必須要經過微信的登錄授權,不能網頁后端請求,所以先要經過用戶同意,通過頁面網頁請求組裝的微信請求鏈接。請求該鏈接, 獲取code后,后端模擬請求。獲取用戶信息。

資源截圖

代碼片段和文件信息

using?System;
using?System.Data;
using?System.Configuration;
using?System.Collections;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.Net;
using?System.Text;
using?System.Runtime.Serialization.Json;
using?System.IO;
namespace?GustBook.WEB.front.html.CommonControl
{
????public?partial?class?wxProcess1?:?System.Web.UI.Page
????{
????????protected?void?Page_Load(object?sender?EventArgs?e)
????????{
????????????if?(!IsPostBack)
????????????{
//????????????????測試號信息
//appID
//wx81b71d9e6fcb9dd8
//appsecret
//1b7fb028c223d1d7283946ee8b52ee4b

????????????????//????????????TTK
????????????????//????????????????wxfef3c2c5833330ea
????????????????//AppSecret(應用密鑰)a808ad45e740c0fa04fc1ca2579b83b5?隱藏?重置


????????????????string?reurl?=?““;
????????????????//傳遞參數,獲取用戶信息后,可跳轉到自己定義的頁面,想怎么處理就怎么處理
????????????????if?(Request.QueryString[“reurl“]?!=?null?&&?Request.QueryString[“reurl“]?!=?““)
????????????????{
????????????????????reurl?=?Request.QueryString[“reurl“].ToString();
????????????????}
????????????????else
????????????????{
????????????????????reurl?=?“http://www.dreamlinker.cn“;
????????????????}

????????????????string?code?=?““;

????????????????//彈出授權頁面(如在不彈出授權頁面基礎下未獲得openid,彈出授權頁面,提示用戶授權)
????????????????if?(Request.QueryString[“auth“]?!=?null?&&?Request.QueryString[“auth“]?!=?““?&&?Request.QueryString[“auth“]?==?“1“)
????????????????{
????????????????????Response.Redirect(“https://open.weixin.qq.com/connect/oauth2/authorize?appid=“?+?“wxfef3c2c5833330ea“?+?“&redirect_uri=http://www.dreamlinker.cn/wxProcess2.aspx?reurl=“?+?reurl?+?“&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect“);
????????????????}
????????????????else
????????????????{
????????????????????//不彈出授權頁面
????????????????????Response.Redirect(“https://open.weixin.qq.com/connect/oauth2/authorize?appid=“?+?“wxfef3c2c5833330ea“?+?“&redirect_uri=http://www.dreamlinker.cn/wxProcess2.aspx?reurl=“?+?reurl?+?“&response_type=code&scope=snsapi_base&state=1#wechat_redirect“);
???????????????????//?https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf0e81c3bee622d60&redirect_uri=http%3A%2F%2Fnba.bluewebgame.com%2Foauth_response.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
????????????????}
????????????}
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2646??2016-03-01?23:21??wxProcess.aspx.cs
?????文件?????????795??2016-02-27?00:17??wxProcess.aspx.designer.cs
?????文件?????????371??2016-02-27?00:17??wxProcess2.aspx
?????文件???????11281??2016-03-02?09:25??wxProcess2.aspx.cs
?????文件?????????796??2016-02-27?00:17??wxProcess2.aspx.designer.cs
?????文件?????????369??2016-02-27?00:17??wxProcess.aspx

評論

共有 條評論

相關資源