SourceCode/jiouosdp/Areas/WeiXinApi/Models/ApiTranAppIdList.cs

(开头部分) 7KB

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

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Timers;
using System.Web;
using System.Xml;
using Wechat;

namespace jiouosdp
{
    /// <summary>
    /// 微信api转发管理类
    /// </summary>
    public class ApiTranAppIdList
    {
        public static Hashtable AppIdList;
        public static Hashtable UserIdList;
        public static string Path;
        static object lockPath = new object();
        static Timer timer;


        public static void Start()
        {
            AppIdList = Hashtable.Synchronized(new Hashtable());
            UserIdList = Hashtable.Synchronized(new Hashtable());

            ReadConfig();

            timer = new Timer(1000 * 60 * 5);
            timer.Elapsed += timer_Elapsed;
            timer.Start();
        }
        static void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            ReadConfig();
        }

        public static void AddConfig(string appid, string userid, string key, string redirect_uri, string iscallauthoevent = "true", string isautoinsert = "false")
        {
            System.Threading.Tasks.Task.Factory.StartNew(() =>
            {
                try
                {
                    if (timer != null) timer.Start();
                    lock (lockPath)
                    {
                        if (AppIdList.ContainsKey(appid) != true)
                        {
                            if (File.Exists(Path) != true)
                                return;

                            XmlDocument doc = new XmlDocument();
                            doc.Load(Path);

                            XmlNode xn = doc.SelectSingleNode("/merchs");
                            XmlElement element = doc.CreateElement("users");
                            element.SetAttribute("appid", appid);
后面还有 149 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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