コード例 #1
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            if ((txtUsername.Text.Length == 0) || (txtPassword.Text.Length == 0))
            {
                MessageBox.Show("I campi vanno compilati tutti: completa prima la maschera.");
                return;
            }

            JADA.Common.SetProxyCredentials(txtUsername.Text, myAES.Encrypt(txtPassword.Text), txtPassword.Text);
            RetryConnection = true;
            this.Close();
        }
コード例 #2
0
ファイル: MgrFormLogin.cs プロジェクト: rleschiera/jada
        private void btnConnetti_Click(object sender, EventArgs e)
        {
            int iRet;

            if ((txtUsername.Text.Length == 0) || (txtPassword.Text.Length == 0) ||
                (txtTelefono.Text.Length == 0) || (txtCellulare.Text.Length == 0) ||
                (txtMail.Text.Length == 0))
            {
                MessageBox.Show("I campi vanno compilati tutti: completa prima la maschera.");
                return;
            }

            if (txtUsername.Text.Contains(" "))
            {
                MessageBox.Show("Il campo user name non può contenere spazi.");
                return;
            }

            winmanager.Globals.connSelf.Nome      = txtNome.Text;
            winmanager.Globals.connSelf.Username  = txtUsername.Text;
            winmanager.Globals.connSelf.Password  = myAES.Encrypt(txtPassword.Text);
            winmanager.Globals.connSelf.Telefono  = txtTelefono.Text;
            winmanager.Globals.connSelf.Cellulare = txtCellulare.Text;
            winmanager.Globals.connSelf.Mail      = txtMail.Text;
            winmanager.Globals.connSelf.UsaAudio  = chkUsaAudio.Checked;
            JADA.Common.UseProxy = chkUseProxy.Checked;

            iRet = winmanager.Globals.connSelf.Open();
            switch (iRet)
            {
            case JADA.Common.CREDENTIAL_OK:
            case 0:
                this.CloseManager = false;
                this.Close();
                break;

            case JADA.Common.CREDENTIAL_UNKNOWN_USER:
                MessageBox.Show("Utente non abilitato alla connessione.");
                break;

            case JADA.Common.CREDENTIAL_WRONG_PASSWORD:
                MessageBox.Show("Password non valida.");
                break;

            default:
                string myMessage = String.Format("Non riesco a collegarmi con il server:\n  - il server potrebbe essere temporaneamente indisponibile;\n  - la rete internet/intranet potrebbe non essere disponibile;\n  - devo usare un proxy per la connessione.");
                MessageBox.Show(myMessage);
                break;
            }
        }