示例#1
0
        private void ActionGmail(string[] accountDetail)
        {
            Doorman.Wait();
            Gmail gmail;

            if (accountDetail.Length == 2)
            {
                gmail = new Gmail(accountDetail[0], accountDetail[1]);
            }
            else if (accountDetail.Length == 4)
            {
                gmail = new Gmail(accountDetail[0], accountDetail[1], accountDetail[2], accountDetail[3]);
            }
            else
            {
                Doorman.Release();
                return;
            }
            bool init = gmail.Init();

            if (!init)
            {
                Doorman.Release();
                return;
            }
            gmail.Connect();

            if (open.Checked)
            {
                while (!gmail.CheckIfClosed())
                {
                    Thread.Sleep(5000);
                }
                Doorman.Release();
                return;
            }

            if (gmail.CheckIfConnected())
            {
                gmail.OldGmail();
                //to spam action
                if (Check_gmail_spam_checked())
                {
                    SpamGmail(gmail);
                }

                //to inbox action()
                if (Check_yahoo_inbox_checked())
                {
                    InboxGmail(gmail);
                }

                gmail.Destroy();
            }
            Doorman.Release();
        }
示例#2
0
        private void Delete_emails(string[] accountDetail)
        {
            Doorman.Wait();
            Yahoo yahoo;

            if (accountDetail.Length == 2)
            {
                yahoo = new Yahoo(accountDetail[0], accountDetail[1]);
            }
            else if (accountDetail.Length == 4)
            {
                yahoo = new Yahoo(accountDetail[0], accountDetail[1], accountDetail[2], accountDetail[3]);
            }
            else
            {
                Doorman.Release();
                return;
            }

            yahoo.Init();
            yahoo.Connect();

            if (yahoo.CheckIfConnected())
            {
                yahoo.Navigate("https://mail.yahoo.com/neo/b/launch");

                if (checkbox_spam_yahoo.Checked)
                {
                    yahoo.DeleteSpam();
                }

                if (checkbox_inbox_yahoo.Checked)
                {
                    //all magic happen here
                    bool repeat_delete_inbox()
                    {
                        if (yahoo.DeleteInbox())
                        {
                            return(yahoo.DeleteInbox());
                        }
                        return(false);
                    }

                    while (repeat_delete_inbox())
                    {
                        Application.DoEvents();
                    }
                    new Logger().Info("All inbox email deleted : " + accountDetail[0]);
                }
            }

            yahoo.Destroy();
            Doorman.Release();
        }
示例#3
0
        private void Delete_emails_gmail(string[] accountDetail)
        {
            Doorman.Wait();
            Gmail gmail;

            if (accountDetail.Length == 2)
            {
                gmail = new Gmail(accountDetail[0], accountDetail[1]);
            }
            else if (accountDetail.Length == 4)
            {
                gmail = new Gmail(accountDetail[0], accountDetail[1], accountDetail[2], accountDetail[3]);
            }
            else
            {
                Doorman.Release();
                return;
            }

            gmail.Init();
            gmail.Connect();
            gmail.OldGmail();

            if (delete_gmail_spam.Checked)
            {
                bool repeat_delete_spam()
                {
                    if (gmail.DeleteSpam())
                    {
                        return(gmail.DeleteSpam());
                    }
                    return(false);
                }

                while (repeat_delete_spam())
                {
                    Application.DoEvents();
                }
                new Logger().Info("All Spam email deleted : " + accountDetail[0]);
            }

            if (delete_gmail_inbox.Checked)
            {
                bool repeat_delete_inbox()
                {
                    if (gmail.DeleteInbox())
                    {
                        return(gmail.DeleteInbox());
                    }
                    return(false);
                }

                while (repeat_delete_inbox())
                {
                    Application.DoEvents();
                }
                new Logger().Info("All inbox email deleted : " + accountDetail[0]);
            }

            gmail.Destroy();
            Doorman.Release();
        }
示例#4
0
        private void ActionYahoo(string[] accountDetail)
        {
            Doorman.Wait();
            Yahoo yahoo;

            if (accountDetail.Length == 2)
            {
                yahoo = new Yahoo(accountDetail[0], accountDetail[1]);
            }
            else if (accountDetail.Length == 4)
            {
                yahoo = new Yahoo(accountDetail[0], accountDetail[1], accountDetail[2], accountDetail[3]);
            }
            else
            {
                Doorman.Release();
                return;
            }
            bool error = yahoo.Init();

            if (!error)
            {
                MessageBox.Show("ERROR INIT", "Error");
                Doorman.Release();
                return;
            }

            if (open.Checked)
            {
                yahoo.Connect();
                yahoo.Navigate("https://mail.yahoo.com/");

                while (!yahoo.CheckIfClosed())
                {
                    Thread.Sleep(5000);
                }
                Doorman.Release();
                return;
            }

            yahoo.Connect();

            if (yahoo.CheckIfConnected())
            {
                yahoo.Navigate("https://mail.yahoo.com/neo/b/launch");

                //to spam action
                if (Check_yahoo_spam_checked())
                {
                    SpamYahoo(yahoo);
                }

                //to inbox action()
                if (Check_yahoo_inbox_checked())
                {
                    InboxYahoo(yahoo);
                }

                yahoo.Destroy();
            }
            Doorman.Release();
        }