예제 #1
0
        public PinObject(string pid,
                         string scrapingaccount,
                         string passwrod,
                         string postingaccount,
                         string postingboard,
                         int delay1,
                         int delay2,
                         string postingaccountusername)
        {
            this.PID = pid;



            this.ScrapingAccount        = scrapingaccount;
            this.PostingAccount         = postingaccount;
            this.PostingAccount         = postingaccountusername;
            this.PostingBoard           = postingboard.Split(new string[] { "[-]" }, StringSplitOptions.None)[1];
            this.Delay1                 = delay1;
            this.Delay2                 = delay2;
            this.PostingAccountUsername = postingaccountusername;
            TaskMangerRow               = Login.DT_TaskManger.Select("PID='" + PID + "'").FirstOrDefault();
            AccountMangerRow            = Login.DT_AccountManager.Select("UserName_Email='" + PID + "'").FirstOrDefault();
            fILEWriter = new FILEWriter();
        }
예제 #2
0
        private async void SimpleButton9_Click(object sender, EventArgs e)
        {
            txt_BoardURL.Text = txt_BoardURL.Text.ToLower().Replace("https://www.pinterest.com/", "").Replace("http://www.pinterest.com/", "").Replace("pinterest.com/", "");
            if (txt_BoardURL.Text.EndsWith("/"))
            {
                txt_BoardURL.Text = txt_BoardURL.Text.TrimEnd(txt_BoardURL.Text[txt_BoardURL.Text.Length - 1]);
            }

            if (Lookup_ScrapingAccount.GetSelectedDataRow() == null || Lookup_PostingAccount.GetSelectedDataRow() == null)
            {
                MessageBox.Show("Please Select The scraping Account And The Posting Accoint! ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (Combo_CurentBoard.SelectedItem == null)
            {
                MessageBox.Show("Please Select an Board ! ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }



            dynamic ScrapingAccount = Lookup_ScrapingAccount.GetSelectedDataRow();
            dynamic PostingAccount  = Lookup_PostingAccount.GetSelectedDataRow();

            if (ScrapingAccount.Row.ItemArray[1].ToString() == "")
            {
                MessageBox.Show("You Must Enter The Password of Scraping Account", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            BackgroundWorker t = new BackgroundWorker();

            t.WorkerSupportsCancellation = true;
            string pid = t.GetHashCode().ToString();

            t.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs a)
            {
                PinObject pinObject = new PinObject(pid, ScrapingAccount.Row.ItemArray[0].ToString(), ScrapingAccount.Row.ItemArray[1].ToString(), PostingAccount.Row.ItemArray[3].ToString(), Combo_CurentBoard.SelectedItem.ToString(), ((int)num1.Value), ((int)num2.Value), PostingAccount.Row.ItemArray[0].ToString());
                pinObject.ScrapBoard(txt_BoardURL.Text, ((int)ScrapBoardLimit.Value));
            });

            TaskList.Add(t);
            //t.RunWorkerAsync();

            TaskManger.Running_Process += t.GetHashCode().ToString();

            FILEWriter fILEWriter = new FILEWriter();

            setscad();

            DT_TaskManger.Rows.Add(
                ScrapingAccount.Row.ItemArray[0].ToString(),
                PostingAccount.Row.ItemArray[0].ToString(),
                TaskManger.TaskMangerProcess.ScrapBoard + "_" + txt_keyword.Text,
                txt_BoardURL.Text,
                Combo_CurentBoard.SelectedItem.ToString(),
                Scad,
                "0",
                "0",
                "0",
                TaskManger.TaskManagerStatus.Ready,
                DateTime.Now.ToString(),
                "",
                t.GetHashCode().ToString(),
                txt_forcechangeurl.Text,
                "",
                PostingAccount.Row.ItemArray[3].ToString(),
                ScrapingAccount.Row.ItemArray[1].ToString(),
                num1.Value,
                num2.Value,
                ScrapBoardLimit.Value,
                PostingAccount.Row.ItemArray[0].ToString());

            Lookup_ScrapingAccount.Enabled = true;
        }