private void StartServerBtn_Click(object sender, RoutedEventArgs e) { int Port; if ((!Int32.TryParse(PortValueTB.Text, out Port)) || (Port < 1000) || (Port > 20000)) { MessageBox.Show("Port must be in range [1000; 20000]!"); return; } int privateKey; if (!Int32.TryParse(SecretKeyTB.Text, out privateKey)) { MessageBox.Show("Key must be an integer!"); return; } int publicKey; if (!Int32.TryParse(OpenKeyTB.Text, out publicKey)) { MessageBox.Show("Key must be an integer!"); return; } this.Server = new classes.ServerChat(publicKey, privateKey, Port); }
public ClientChat(TcpClient TcpClient, byte Id, ServerChat Server) { this.isAuthorised = false; this.isValidLogin = false; this.TcpClient = TcpClient; this.Server = Server; this.Id = Id; this.Cipher = new Cipher(); }