Пример #1
0
        private void SignIn_Click(object sender, RoutedEventArgs e)
        {
            IPHostEntry entry = Dns.Resolve("localhost");
            IPAddress   ip    = entry.AddressList[0];

            clientManager            = new ClientManager();
            clientManager.Connected += connection;
            clientManager.Received  += received;
            clientManager.Connect(Convert.ToString(ip), 11000);
        }
Пример #2
0
 private void SignUpBtn_Click(object sender, EventArgs e)
 {
     UserName = LoginBox.Text;
     Password = PasswordBox.Text;
     if (IsLoginCorrect(UserName) && IsPasswordCorrect(Password))
     {
         try
         {
             currentClient.Connect();
             if (currentClient.SendSignUpData(UserName, Password))
             {
                 fmain.IsLogin            = true;
                 fmain.UserNameLabel.Text = UserName;
                 this.Hide();
             }
         }
         catch
         {
             MessageBox.Show("Ошибка связи с сервером!");
         }
     }
 }
Пример #3
0
 private void WinMain_Load(object sender, EventArgs e)
 {
     LogAction.LogOut += LogAction_LogOut;
     if (ClientManager.Connect("127.0.0.1", 3775))
     {
         ClientManager.Client.Install(this);
         LogOn tmp = new LogOn();
         tmp.ShowDialog();
     }
     else
     {
         MessageBox.Show("Not Connect Server");
         this.Close();
     }
 }
Пример #4
0
 private void SignInBtn_Click(object sender, EventArgs e)
 {
     UserName = LoginBox.Text;
     if (IsLoginCorrect(UserName) && currentClient.ServerInformation)
     {
         try
         {
             if (currentClient.Connect(UserName))
             {
                 fmain.IsLogin            = true;
                 fmain.UserNameLabel.Text = UserName;
                 this.Hide();
             }
         }
         catch
         {
             MessageBox.Show("Ошибка связи с сервером!");
         }
     }
 }