Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox3.Visible)
            {
                if (textBox2.Text != textBox3.Text)
                {
                    MessageBox.Show("Make your password the same!", "Info");
                    textBox2.Text = "";
                    textBox3.Text = "";
                    return;
                }
                using (var client = new WebClient())
                {
                    var values = new NameValueCollection();
                    values["login"]    = textBox1.Text;
                    values["password"] = textBox2.Text;

                    var response       = client.UploadValues("http://vasylko.zzz.com.ua/index.php/api/adduser", values);
                    var responseEnter  = client.UploadValues("http://vasylko.zzz.com.ua/index.php/api/fd", values);
                    var responseString = Encoding.Default.GetString(responseEnter);
                    transferPackage = JsonConvert.DeserializeObject <TransferPackage>(responseString);
                    Close();
                }
            }
            else
            {
                textBox3.Visible = true;
            }
        }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!textBox3.Visible)
     {
         using (var client = new WebClient())
         {
             try
             {
                 var values = new NameValueCollection();
                 values["login"]    = textBox1.Text;
                 values["password"] = textBox2.Text;
                 var response       = client.UploadValues("http://vasylko.zzz.com.ua/index.php/api/fd", values);
                 var responseString = Encoding.Default.GetString(response);
                 transferPackage = JsonConvert.DeserializeObject <TransferPackage>(responseString);
                 Close();
             }
             catch (Exception ex)
             {
                 MessageBox.Show("Wrong email or password", "Warning");
                 textBox2.Text = "";
             }
         }
     }
     else
     {
         textBox3.Visible = false;
     }
 }
Пример #3
0
        public Form1()
        {
            InitializeComponent();
            button1.Visible = false;
            Start st = new Start();

            st.ShowDialog();
            TransferPackage = st.getTrPack();
            foreach (var note in TransferPackage.notes)
            {
                listBox1.Items.Add(note);
            }
        }
Пример #4
0
        private void logOutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            textBox1.Text = "";
            textBox2.Text = "";
            Start st = new Start();

            st.ShowDialog();

            TransferPackage = st.getTrPack();
            foreach (var note in TransferPackage.notes)
            {
                listBox1.Items.Add(note);
            }
        }