Example #1
0
        private void GetProcessPath()
        {
            ConfigurationItems config = new ConfigurationItems();

            rtbTip.Text = config.GetNowAssembly();//config.GetProcessPath();
            this.Text  += config.JoinProcessPath();
        }
Example #2
0
        public void CreateJob <T>(int interval, int repeactCount) where T : IJob //调用的实体需要继承IJob
        {
            if (interval == 0)
            {
                interval = 1;
            }
            // Console.WriteLine(DateTime.Now.ToString());
            ISchedulerFactory schedf = new StdSchedulerFactory();//pool

            scheduler = schedf.GetScheduler();
            string         jobName = typeof(T).Name;
            string         group   = new ConfigurationItems().AppNameEng;
            IJobDetail     job     = JobBuilder.Create <T>().WithIdentity(jobName, group).Build();//job
            ISimpleTrigger trigger = (ISimpleTrigger)TriggerBuilder.Create().
                                     WithSimpleSchedule(x => x.WithIntervalInSeconds(interval).
                                                        WithRepeatCount(repeactCount)).Build();
            //如果存在该作业,进行替换
            JobKey     jy     = new JobKey(jobName, group);
            IJobDetail detail = scheduler.GetJobDetail(jy);

            if (detail == null)
            {
                scheduler.ScheduleJob(job, trigger);//in pool
                scheduler.Start();
                scheduler.PauseJob(jy);
            }
            //执行多少次之后结束
            else
            {
                // scheduler.DeleteJob(jy);
            }
        }
Example #3
0
        public override void Execute(INotification notification)
        {
            switch (notification.Type)
            {
            case AppNotify.Get_UinTotal:
                Task.Factory.StartNew(() =>
                {
                    Domain.CommonData.PickUpStatic pc = (new QQDataDA()).TodayStatic();
                    SendNotification(AppNotify.Back_UinTotal, pc);
                });
                break;

            case AppNotify.Get_CityData:
                Task.Factory.StartNew(() =>
                {
                    List <CategoryData> list = new DataFromManage().QueryCities();
                    SendNotification(AppNotify.Back_CityData, list);
                });
                break;

            case AppNotify.Get_UsableProxy:
                Task.Factory.StartNew(() =>
                {
                    string connString    = new ConfigurationItems().GetConnString("Proxy_Read");
                    ProxyDataService api = new ProxyDataService(connString);
                    List <ProxyDataService.Proxy> proxy = api.GetUsageProxy();
                });
                break;
            }
            //base.Execute(notification);
        }
Example #4
0
        void InitIpNumber()
        {
            ConfigurationItems config    = new ConfigurationItems();
            VIpAddressService  ipservice = new VIpAddressService(config.IpDataSrc);

            totalIp = ipservice.Count();
        }
Example #5
0
        private PickUpQQDoResponse ForeachFindQQ(QueryQQParam param, string cookie)
        {
            string json    = param.UrlParam();
            string logPath = LogPrepare.GetLogPath();

            LoggerWriter.CreateLogFile(json, logPath, ELogType.ParamLog);
            string response = HttpClientExtend.HttpWebRequestPost(findQQAccountUrl, json, cookie);
            //将查询反馈的数据写入到数据库中

            // LoggerWriter.CreateLogFile(response, logPath, ELogType.DataLog);
            ConfigurationItems c        = new ConfigurationItems();
            FindQQDataManage   manage   = new FindQQDataManage(c.TecentDA_Read);
            JsonData           jsondata = new JsonData();
            PickUpQQDoResponse pickup   = new PickUpQQDoResponse();

            pickup.responseData = manage.SaveFindQQ(response);
            //此处开启一个线程查询qq群组

            pickup.cookie       = cookie;
            pickup.request      = json;
            pickup.responseJson = response;
            if (callback != null)
            {
            }
            return(pickup);
        }
Example #6
0
        public void DeleteJob <T>() where T : IJob
        {//删除上次运行程序没有关闭的作业
            Type   t     = typeof(T);
            string group = new ConfigurationItems().AppNameEng;

            //string group = "PickUpDataResD";// new ConfigurationItems().AppNameEng;
            DeleteJob(t.Name, group);
            DeleteJob(t.FullName, group);
        }
Example #7
0
        void  EmportIpAddress(List <QQZengResponseData> list)
        {
            List <IpDataMapTable> target = list.Select(qqz => qqz.ConvertMapModel <QQZengResponseData, IpDataMapTable>(true))
                                           .Where(ip => { ip.InitData(); return(true); }).ToList();
            ConfigurationItems config = new ConfigurationItems();
            //IPService ps = new IPService(config.SaveIpAddressConnString);
            bool succ = false;// ps.SaveList(target); ;

            if (succ)
            {
                list = new List <QQZengResponseData>();
            }
        }
Example #8
0
        void QueryIpSrc()
        {
            int start = (pageIndex - 1) * pageList + 1;
            int end   = pageIndex * pageList;

            if (start >= totalIp)
            {
                rtbTip.Text = "已执行到最后一条";
                return;
            }
            ConfigurationItems config    = new ConfigurationItems();
            VIpAddressService  ipservice = new VIpAddressService(config.IpDataSrc);

            foreachIP = ipservice.GetIpData(start, end);
            pageIndex++;
        }
 /// <summary>
 /// 使用System.Data.SQLite 访问sqlite数据库
 /// </summary>
 public void GetCityDatas()
 {
     try
     {
         ConfigurationItems cfg  = new ConfigurationItems();
         SQLiteConnection   conn = new SQLiteConnection(cfg.SqliteDbConnString);
         conn.Open();
         string            sql  = "select * from CategoryData";
         SQLiteCommand     comq = new SQLiteCommand(sql, conn);
         SQLiteDataAdapter dap  = new SQLiteDataAdapter();
         dap.SelectCommand = comq;
         DataSet ds = new DataSet();
         dap.Fill(ds);
         conn.Clone();
     }
     catch (Exception ex)
     {
     }
 }