示例#1
0
 public SubmitPriceStep2Job(String endPoint, IOrc orcPrice, IOrc orcLoading, CaptchaUtil captchaUtil, IOrc orcCaptcha)
 {
     this.EndPoint = endPoint;
     this.m_orcPrice = orcPrice;
     this.m_orcLoading = orcLoading;
     this.m_captchaUtil = captchaUtil;
     this.m_orcCaptcha = orcCaptcha;
 }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            System.Console.WriteLine(logger.IsDebugEnabled);
            Form.CheckForIllegalCrossThreadCalls = false;
            this.textURL.Text = this.m_endPoint;
            this.m_step2Form = new Step2Form();
            this.m_step1Form = new Step1Form();

            IGlobalConfig configResource = Resource.getInstance(this.m_endPoint);//加载配置

            this.Text = configResource.tag;
            this.m_orcLogin = configResource.Login;
            this.m_orcCaptcha = configResource.Captcha;//验证码
            this.m_orcPrice = configResource.Price;//价格识别
            this.m_orcCaptchaLoading = configResource.Loading;//LOADING识别
            this.m_orcCaptchaTip = configResource.Tips;//验证码提示(文字)
            this.m_orcCaptchaTipsUtil = new CaptchaUtil(m_orcCaptchaTip);

            //加载配置项2
            KeepAliveJob keepAliveJob = new KeepAliveJob(this.m_endPoint,
                new ReceiveLogin(this.receiveLogin),
                new ReceiveOperation[]{
                    new ReceiveOperation(this.receiveStep1),
                    new ReceiveOperation(this.receiveStep2)});
            keepAliveJob.Execute();

            //keepAlive任务配置
            SchedulerConfiguration config5M = new SchedulerConfiguration(1000 * 60 * 1);
            config5M.Job = new KeepAliveJob(this.m_endPoint,
                new ReceiveLogin(this.receiveLogin),
                new ReceiveOperation[]{
                    new ReceiveOperation(this.receiveStep1),
                    new ReceiveOperation(this.receiveStep2)});
            m_schedulerKeepAlive = new Scheduler(config5M);

            //Action任务配置
            SchedulerConfiguration config1S = new SchedulerConfiguration(1000);
            config1S.Job = new SubmitPriceStep2Job(this.m_endPoint, this.m_orcPrice, this.m_orcCaptchaLoading, this.m_orcCaptchaTipsUtil, m_orcCaptcha);
            m_schedulerSubmit = new Scheduler(config1S);

            Hotkey.RegisterHotKey(this.Handle, 103, Hotkey.KeyModifiers.Ctrl, Keys.D3);
            Hotkey.RegisterHotKey(this.Handle, 104, Hotkey.KeyModifiers.Ctrl, Keys.D4);
            Hotkey.RegisterHotKey(this.Handle, 105, Hotkey.KeyModifiers.Ctrl, Keys.D5);
            Hotkey.RegisterHotKey(this.Handle, 106, Hotkey.KeyModifiers.Ctrl, Keys.D6);
            Hotkey.RegisterHotKey(this.Handle, 107, Hotkey.KeyModifiers.Ctrl, Keys.D7);
            Hotkey.RegisterHotKey(this.Handle, 108, Hotkey.KeyModifiers.Ctrl, Keys.D8);
            Hotkey.RegisterHotKey(this.Handle, 109, Hotkey.KeyModifiers.Ctrl, Keys.D9);

            Hotkey.RegisterHotKey(this.Handle, 121, Hotkey.KeyModifiers.Ctrl, Keys.Left);
            Hotkey.RegisterHotKey(this.Handle, 120, Hotkey.KeyModifiers.Ctrl, Keys.Up);
            Hotkey.RegisterHotKey(this.Handle, 122, Hotkey.KeyModifiers.Ctrl, Keys.Right);
            Hotkey.RegisterHotKey(this.Handle, 123, Hotkey.KeyModifiers.Ctrl, Keys.Enter);
            Hotkey.RegisterHotKey(this.Handle, 124, Hotkey.KeyModifiers.None, Keys.Escape);

            Hotkey.RegisterHotKey(this.Handle, 155, Hotkey.KeyModifiers.CtrlShift, Keys.Enter);
        }
示例#3
0
 public CaptchaUtil(IOrc[] tips)
 {
     this.orcTips = tips;
 }
示例#4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            logger.Info("Application Form Load");

            Form.CheckForIllegalCrossThreadCalls = false;
            this.dateTimePicker1.Value = DateTime.Now;

            //加载配置项1
            IGlobalConfig configResource = Resource.getInstance(this.EndPoint);//加载配置

            this.Text = configResource.tag;
            this.m_orcTitle = configResource.Title;
            this.m_orcCaptcha = configResource.Captcha;//
            this.m_orcPrice = configResource.Price;//价格识别
            this.m_orcCaptchaLoading = configResource.Loading;//LOADING识别
            this.m_orcCaptchaTip = configResource.Tips;//验证码提示(文字)
            this.m_orcCaptchaTipsUtil = new CaptchaUtil(m_orcCaptchaTip);

            //加载配置项2
            KeepAliveJob keepAliveJob = new KeepAliveJob(this.EndPoint,
                new ReceiveLogin(this.receiveLogin),
                new ReceiveOperation[]{
                    new ReceiveOperation(this.receiveOperation),
                    new ReceiveOperation(this.receiveOperation)});
            keepAliveJob.Execute();

            //keepAlive任务配置
            SchedulerConfiguration config1M = new SchedulerConfiguration(1000 * 60 * 1);
            config1M.Job = new KeepAliveJob(this.EndPoint,
                new ReceiveLogin(this.receiveLogin),
                new ReceiveOperation[]{
                    new ReceiveOperation(this.receiveOperation),
                    new ReceiveOperation(this.receiveOperation)});
            this.m_schedulerKeepAlive = new Scheduler(config1M);

            //Action任务配置
            SchedulerConfiguration configStep2 = new SchedulerConfiguration(1000);
            configStep2.Job = new SubmitPriceStep2Job(this.EndPoint, this.m_orcPrice, this.m_orcCaptchaLoading, this.m_orcCaptchaTipsUtil, this.m_orcCaptcha);
            m_schedulerSubmitStep2 = new Scheduler(configStep2);

            Hotkey.RegisterHotKey(this.Handle, 103, Hotkey.KeyModifiers.Ctrl, Keys.D3);
            Hotkey.RegisterHotKey(this.Handle, 104, Hotkey.KeyModifiers.Ctrl, Keys.D4);
            Hotkey.RegisterHotKey(this.Handle, 105, Hotkey.KeyModifiers.Ctrl, Keys.D5);
            Hotkey.RegisterHotKey(this.Handle, 106, Hotkey.KeyModifiers.Ctrl, Keys.D6);
            Hotkey.RegisterHotKey(this.Handle, 107, Hotkey.KeyModifiers.Ctrl, Keys.D7);
            Hotkey.RegisterHotKey(this.Handle, 108, Hotkey.KeyModifiers.Ctrl, Keys.D8);
            Hotkey.RegisterHotKey(this.Handle, 109, Hotkey.KeyModifiers.Ctrl, Keys.D9);

            Hotkey.RegisterHotKey(this.Handle, 202, Hotkey.KeyModifiers.Ctrl, Keys.Up);
            Hotkey.RegisterHotKey(this.Handle, 201, Hotkey.KeyModifiers.Ctrl, Keys.Left);
            Hotkey.RegisterHotKey(this.Handle, 203, Hotkey.KeyModifiers.Ctrl, Keys.Right);
            Hotkey.RegisterHotKey(this.Handle, 204, Hotkey.KeyModifiers.Ctrl, Keys.Enter);

            Hotkey.RegisterHotKey(this.Handle, 221, Hotkey.KeyModifiers.None, Keys.Escape);
            Hotkey.RegisterHotKey(this.Handle, 222, Hotkey.KeyModifiers.None, Keys.Enter);
        }