Exemple #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String         username = tbUsr.Text;
            String         password = tbPswd.Text;
            EnvyUser       user     = new EnvyUser(username, password);
            String         host     = tbHost.Text;
            EnvyConnection conn     = new EnvyConnection(host, 2356);

            if (conn.Connect())
            {
                Console.WriteLine("CONNECTED");
                var ap = new EnvyClientAuthProtocol(conn);
                if (ap.AuthenticateUser(user))
                {
                    lblStatus.Visible = true;
                }
                ap.AuthenticateUser(user);
            }
        }
 public EnvyClientAuthProtocol(EnvyConnection connection)
 {
     activeConnection = connection;
     terminate        = false;
 }