zoukankan      html  css  js  c++  java
  • 微信OAuth2网页授权

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using YTO.WeiXin.Model;
    using YTO.Framework.Core;
    using Newtonsoft.Json.Linq;
    using Newtonsoft.Json;
    
    namespace WeiXin.Core
    {
        public class OAuth20
        {
            public static string OAuth(string code)
            {
                string AppID = JobBase.GetConfParamValue(ParamEnum.AppID).ToString();
                string AppSecret = JobBase.GetConfParamValue(ParamEnum.AppSecret).ToString();
                string url = string.Format("https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", AppID, AppSecret, code);
                string Jsonstr = RequestHelper.SendGet(url);
                JObject obj = JObject.Parse(Jsonstr);
                string openId = obj["openid"].ToString().Replace(""",string.Empty);
                return openId;
            }
        }
    }
  • 相关阅读:
    spider
    python 2.X
    django 创建项目
    NameError: name 'pip' is not defined
    异常捕获
    @property
    node-Telnet
    ES6-模块化
    高级排序算法之双路快速排序
    高级排序算法之快速排序
  • 原文地址:https://www.cnblogs.com/slu182/p/4252732.html
Copyright © 2011-2022 走看看