Hidistro.UI.Common.Controls/WeixinSet.cs

(开头部分) 7KB

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

namespace Hidistro.UI.Common.Controls
{
    using Hidistro.Core;
    using Hidistro.Core.Entities;
    using Hishop.Weixin.MP.Api;
    using Newtonsoft.Json;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Net;
    using System.Net.Security;
    using System.Runtime.InteropServices;
    using System.Security.Cryptography.X509Certificates;
    using System.Text;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class WeixinSet : Literal
    {
        public string _GetTokenError = "";
        public string htmlAppID = string.Empty;
        public string htmlNonceStr = "QoN4FvGbxdTi7mnffL";
        public string htmlSignature = string.Empty;
        public string htmlstring1 = string.Empty;
        public string htmlTicket = string.Empty;
        public string htmlTimeStamp = string.Empty;
        public string htmlToken = string.Empty;

        public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
        {
            return true;
        }

        public static int ConvertDateTimeInt(DateTime time)
        {
            DateTime time2 = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(0x7b2, 1, 1));
            TimeSpan span = (TimeSpan) (time - time2);
            return (int) span.TotalSeconds;
        }

        public string DoGet(string url)
        {
            HttpWebRequest webRequest = this.GetWebRequest(url, "GET");
            webRequest.ContentType = "application/x-www-form-urlencoded;charset=utf-8";
            HttpWebResponse rsp = (HttpWebResponse) webRequest.GetResponse();
            Encoding encoding = Encoding.UTF8;
            return this.GetResponseAsString(rsp, encoding);
        }

        private string GetCacheToken(string appid, string secret)
        {
            string str = TokenApi.GetToken_Message(appid, secret);
            if ((!string.IsNullOrEmpty(str) && str.Contains("errmsg")) && str.Contains("errcode"))
            {
                Dictionary<string, string> dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(str);
                if (((dictionary != null) && dictionary.ContainsKey("errcode")) && dictionary.ContainsKey("errmsg"))
                {
                    this._GetTokenError = dictionary["errcode"] + "|" + dictionary["errmsg"];
                    return str;
后面还有 116 行代码,购买后查看完整代码

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

AI 解读 AI

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

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