Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool requireLogin = AppConfig.GetRequireLogin();

            if (requireLogin && (string.IsNullOrEmpty(txtUsername.Text) || string.IsNullOrEmpty(txtPassword.Text)))
            {
                MessageBox.Show("Invalid user login");
                return;
            }
            if (requireLogin)
            {
                string str = ScrapperMinPool.RunSingle(AppConfig.GetScriptPrefix() + "SBF_LOGIN", new string[] { txtUsername.Text, txtPassword.Text });
                if (str == "FAIL LOGIN")
                {
                    MessageBox.Show("Invalid user login");
                    return;
                }
            }

            AppConfig.AddOrUpdateAppSettings("User", txtUsername.Text);
            AppConfig.AddOrUpdateAppSettings("Pass", txtPassword.Text);
            if (AppLicense.IsValid("", "", AppConfig.GetLicense()) == false)
            {
                MessageBox.Show("Invalid License Key");
                return;
            }
            Form2 frm = new Form2(txtUsername.Text, txtPassword.Text);

            frm.ShowDialog();
        }
Beispiel #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (AppLicense.IsValid("", "", AppConfig.GetLicense()) == false)
     {
         string str = AppLicense.GetLicense("", "", "", DateTime.Now.AddDays(7));
         AppConfig.AddOrUpdateAppSettings("License", str);
         if (string.IsNullOrEmpty(str) == false)
         {
             MessageBox.Show("Trial is activated");
             button4.Visible = false;
             if (AppConfig.GetRequireLogin() == false)
             {
                 txtUsername.Visible = false;
                 txtPassword.Visible = false;
                 label3.Visible      = false;
                 label2.Text         = "Click NEXT to continue";
                 label2.TextAlign    = ContentAlignment.MiddleCenter;
             }
         }
         else
         {
             MessageBox.Show("Fail activating trial");
             return;
         }
     }
 }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            txtUsername.Text = AppConfig.GetUser();
            txtPassword.Text = AppConfig.GetPass();
            button4.Visible  = AppLicense.RequireLicense & string.IsNullOrEmpty(AppConfig.GetLicense());

            bool requireLogin = AppConfig.GetRequireLogin();

            bool licenseValid = AppLicense.IsValid("", "", AppConfig.GetLicense());

            if (licenseValid)
            {
                button4.Visible = false;
            }
            if (Force == false && licenseValid)
            {
                if (requireLogin)
                {
                    if ((string.IsNullOrEmpty(txtUsername.Text) == false && string.IsNullOrEmpty(txtPassword.Text) == false))
                    {
                        Form2 frm = new Form2(txtUsername.Text, txtPassword.Text);
                        frm.ShowInTaskbar = true;
                        frm.ShowDialog();
                    }
                }
                else
                {
                    Form2 frm = new Form2(txtUsername.Text, txtPassword.Text);
                    frm.ShowInTaskbar = true;
                    frm.ShowDialog();
                }
                return;
            }

            if (requireLogin == false)
            {
                txtUsername.Visible = false;
                txtPassword.Visible = false;

                label3.Visible = false;
                if (licenseValid == false)
                {
                    label2.Text = "Please activate license or trial";
                }
                else
                {
                    label2.Text = "Click NEXT to continue";
                }
            }
        }
Beispiel #4
0
        private void Form2_Load(object sender, EventArgs e)
        {
            richTextBox2.Text = AppConfig.GetDomains();
            richTextBox3.Text = AppConfig.GetIgnoreDomains();
            richTextBox4.Text = AppConfig.GetIgnoreBodies();
            richTextBox5.Text = AppConfig.GetBodies();
            richTextBox6.Text = AppConfig.GetMaxThreadPage().ToString();
            richTextBox7.Text = AppConfig.GetParallelism().ToString();
            checkBox1.Checked = AppConfig.GetFirstPage();

            if (AppLicense.IsValid("", "", AppConfig.GetLicense()) == false)
            {
                MessageBox.Show("Invalid License Key");
                Environment.Exit(0);
                return;
            }
        }
Beispiel #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            Form3 frm = new Form3();

            frm.ShowDialog();
            if (AppLicense.IsValid("", "", AppConfig.GetLicense()))
            {
                button4.Visible = false;
                if (AppConfig.GetRequireLogin() == false)
                {
                    txtUsername.Visible = false;
                    txtPassword.Visible = false;
                    label3.Visible      = false;
                    label2.Text         = "Click NEXT to continue";
                    label2.TextAlign    = ContentAlignment.MiddleCenter;
                    button4.Visible     = false;
                }
            }
        }
Beispiel #6
0
 private void Form3_Load(object sender, EventArgs e)
 {
     txtProductCode.Text = AppLicense.GetProductCode();
     txtActivation.Text  = AppConfig.GetLicense();
     if (AppLicense.IsValid("", "", txtActivation.Text))
     {
         DateTime dt = AppLicense.GetValidUntilDate("", "", txtActivation.Text);
         if (dt == DateTime.MinValue)
         {
             lblUntil.Text = "No License";
         }
         else
         {
             lblUntil.Text = "License Valid Until : " + dt.ToString("dd MMM yyyy hh:mm tt");
         }
     }
     else
     {
         lblUntil.Text = "No License";
     }
     txtProductCode_TextChanged(txtProductCode, EventArgs.Empty);
 }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (AppLicense.IsValid("", "", txtActivation.Text) == false)
            {
                MessageBox.Show("Invalid License Key");
                return;
            }

            DateTime dt2 = AppLicense.GetValidUntilDate("", "", AppConfig.GetLicense());
            DateTime dt  = AppLicense.GetValidUntilDate("", "", txtActivation.Text);

            if (dt > dt2)
            {
                MessageBox.Show("Thank you for activating");
                AppConfig.AddOrUpdateAppSettings("License", txtActivation.Text);
            }
            else
            {
                MessageBox.Show("Fail to apply old license");
            }
            Close();
        }