Example #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     md5engine md5 = new md5engine();
     string pass = md5.EncodePassword(textBox6.Text).ToLower();
     string compare = "http://nicoding.com/api.php?app=ripleech&user="******"&info=password";
     WebClient web = new WebClient();
     System.IO.Stream stream = web.OpenRead(compare);
     string storedpass = null;
     using (System.IO.StreamReader reader = new System.IO.StreamReader(stream))
     {
         storedpass = reader.ReadToEnd();
     }
     if (storedpass == pass)
     {
         RipLeech.Properties.Settings.Default.loggedinuser = textBox5.Text;
         RipLeech.Properties.Settings.Default.Save();
         label1.Text = textBox5.Text;
         string acctype = "http://nicoding.com/api.php?app=ripleech&user="******"&info=ispaid";
         WebClient acc = new WebClient();
         System.IO.Stream streamlol = web.OpenRead(acctype);
         using (System.IO.StreamReader acctypereader = new System.IO.StreamReader(streamlol))
         {
             string accountype = acctypereader.ReadToEnd();
             if (accountype == "no")
             {
                 label2.Text = "Free";
             }
             else
             {
                 label2.Text = "Monthly";
             }
         }
         groupBox1.Visible = true;
         groupBox2.Visible = false;
     }
     else
     {
         pictureBox5.Visible = true;
         timer3.Start();
     }
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textBox3.Text) && !String.IsNullOrEmpty(textBox4.Text))
            {
                string url = "http://nicoding.com/api.php?app=nivid&id=" + textBox3.Text;
                WebClient wc = new WebClient();
                string data = wc.DownloadString(url);
                md5engine md5 = new md5engine();
                string pass = comparepass(md5.EncodePassword(textBox4.Text).ToLower());
                if (pass == "Invalid Pass!")
                {
                    MessageBox.Show("The password you have entered is incorrect!");
                }
                else
                {
                if (data == "You have supplied an invalid id! Please try again.")
                {
                    if (MessageBox.Show("Are you a new user?", "Error: ID Not Found!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        MessageBox.Show("You are a new user! YAY!");
                    }
                    else
                    {
                        MessageBox.Show("You are not a new user! BOO!");
                    }

                }
                else
                {
                    ConnectToServer(data);
                }
              }
            }
            else
            {
                MessageBox.Show("You have not provided a NiVid id or password!");
            }
        }