Exemple #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     this.Size        = new System.Drawing.Size(320, 517);
     this.MinimumSize = new System.Drawing.Size(320, 517);
     this.MaximumSize = new System.Drawing.Size(320, 517);
     AcsesstokenPanel.Hide();
     keywork_txt.AutoCompleteCustomSource.Add("FB Messagner");
     keywork_txt.AutoCompleteCustomSource.Add("Ahmed Korwash");
 }
Exemple #2
0
 private void metroButton1_Click_1(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(_UsernameLogin.Text) && !string.IsNullOrEmpty(_PasswordLogin.Text))
     {
         try
         {
             realLogin = new AuthFaceBook(_UsernameLogin.Text, _PasswordLogin.Text);
             if (realLogin.IsLogin)
             {
                 AcsesstokenPanel.Show();
                 MessageBox.Show("Welcome sir, Your Account Connected Sucsessfully with Facebook",
                                 "Login Succeeded", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 Login_btn.Enabled = false;
             }
             else
             {
                 MessageBox.Show("Username or Password invalid", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("UnExpected Error, Maybe the connection was lost..." + Environment.NewLine + ex.Message,
                             "UnExpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Please Write Username and Password", "Fields Requiered", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (string.IsNullOrEmpty(_UsernameLogin.Text))
         {
             this._UsernameLogin.WithError = true;
         }
         if (string.IsNullOrEmpty(_PasswordLogin.Text))
         {
             this._PasswordLogin.WithError = true;
         }
     }
 }