Ejemplo n.º 1
0
        private void m_btnOk_Click(object sender, System.EventArgs e)
        {
            string  []     macAddresses;
            CSessionClient session = CSessionClient.CreateInstance();
            int            i;

            NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();

            macAddresses = new string[nics.Length];

            i = 0;
            foreach (NetworkInterface adapter in nics)
            {
                macAddresses.SetValue(adapter.GetPhysicalAddress().ToString(), i);
                i++;
            }

            CResultAErreur result = session.OpenSession(new CAuthentificationSessionTimosLoginPwd(
                                                            m_txtLogin.Text,
                                                            m_txtPassword.Text,
                                                            new CParametresLicence(CAuthentificateurTimos.GetIdsSupportAmovibles(),
                                                                                   CAuthentificateurTimos.GetMACs())));

            if (!result)
            {
                CFormAlerte.Afficher(result.Erreur);
                return;
            }
            CTimosApp.SessionClient = session;
            DialogResult            = DialogResult.OK;
            Close();
        }
Ejemplo n.º 2
0
        public static bool AuthentifierUtilisateur(Thread thSplash)
        {
            CResultAErreur result = CResultAErreur.False;

            if ((Control.ModifierKeys & Keys.Shift) == 0)
            {
                result = CAuthentificateurTimos.TryAuthentificationSupportAmovible();
                if (!result)
                {
                    result = CAuthentificateurTimos.TryAuthentificationAD();
                }
            }
            if (thSplash != null)
            {
                thSplash.Abort();
            }
            if (!result)
            {
                return(AuthentificationLogin());
            }

            return(result.Result);
        }