Esempio n. 1
0
        //Conexion
        private bool connect()
        {
            int ans;
            Form connectingMsg = new MessageForm("Info", "Conectando...");
            connectingMsg.Show();

            if ((ans = serviceMgr.ConnectRemoteMachine(this.textBox_machineName.Text, this.textBox_domain.Text, this.textBox_username.Text, this.textBox_password.Text)) != 0)
            {
                string errorCause;
                if (ans == 1)
                    errorCause = "Acceso denegado.";
                else if (ans == 2)
                    errorCause = "Servidor remoto no disponible o no autorizado.";
                else
                    errorCause = "Intente nuevamente.";

                connectingMsg.Close();
                connected = false;
                MessageBox.Show("No se pudo conectar al equipo remoto: " + errorCause, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                connected = true;
                connectingMsg.Close();
            }

            return connected;
        }
Esempio n. 2
0
        private void button_listServices_Click(object sender, EventArgs e)
        {
            if (!connected && !this.connect())
                return;

            Form retrievingMsg = new MessageForm("Info", "Solicitando datos...");
            retrievingMsg.Show();

            var state = serviceMgr.GetRemoteServices();
            this.listBox_results.DataSource = state;
            this.listBox_results.DisplayMember = "FullName";

            showGroupBoxMode(Mode.service);
            retrievingMsg.Close();
        }