示例#1
0
 private void Connection_StateChange(object sender, StateChangeEventArgs e)
 {
     if (e.CurrentState == ConnectionState.Open)
     {
         count++;
         if (count == 3)
         {
             EnterPasswordWindow pass = new EnterPasswordWindow(this);
             this.Invoke(new Action(() =>
             {
                 pass.Show();
             }));
         }
     }
     else
     {
         MessageBox.Show("Connection state is ", "NOT OK" + e.CurrentState);
     }
 }
示例#2
0
 private void Connection_StateChange(object sender, StateChangeEventArgs e)
 {
     if (e.CurrentState == ConnectionState.Open)
     {
         count++;
         if (count == 3)
         {
             EnterPasswordWindow pass = new EnterPasswordWindow(this);
             this.Invoke(new Action(() =>
             {
                 pass.Show();
             }));
         }
     }
     else
     {
         MessageBox.Show("Connection state is ", "NOT OK" + e.CurrentState);
     }
 }