VideoHome.Wap/qqopen/backurl.aspx.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using myfilm.Web.qqopen.Class;
using Newtonsoft.Json;

namespace myfilm.Web.qqopen
{
    public partial class backurl : System.Web.UI.Page
    {
        protected internal myfilm.Config.GeneralConfigInfo config;
        private readonly string client_id = Utils.GetAppSeting("qzone_AppID");
        private readonly string client_secret = Utils.GetAppSeting("qzone_AppKey");
        private readonly string redirect_uri = Utils.GetAppSeting("qzone_Redirect_uri");

        //临时变量,发送URL,接受返回结果
        private string send_url = "", rezult = "";
        //用于第三方应用防止CSRF攻击,成功授权后回调时会原样带回。
        private string state = "";
        //临时Authorization Code,官方提示10分钟过期
        private string code = "";
        //通过Authorization Code返回结果获取到的Access Token
        private string access_token = "";
        //expires_in是该Access Token的有效期,单位为秒
        private string expires_in = "";
        //通过Access Token返回来的client_id 
        private string new_client_id = "";
        //通过Access Token返回来的openid,QQ用户唯一值,可以与网站用户数据关联
        private string openid = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            DoCallback();
        }

        void DoCallback()
        {
            //取得state
            state = Utils.GetQueryString("state");

            try
            {
                if (HttpContext.Current.Session["state"] == null || HttpContext.Current.Session["state"].ToString() == "")
                {
                    HttpContext.Current.Response.Write("state未初始化");
                    HttpContext.Current.Response.End();
                }
            }
            catch
            {
                //写日志
                Logs.logSave("state未初始化");
            }

            //如果返回state与之前发出的判断正确
            if (state == HttpContext.Current.Session["state"].ToString())
            {
后面还有 201 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。