Exemple #1
0
 private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         client = new ChannelFactory <IUdonContract>("Udon").CreateChannel();
     }
     catch
     {
         this.ShowMessageAsync("Ошибка", "Невозможно подключиться к серверу! Перезапустите приложение!");
     }
     SmtpLog.client_create("*****@*****.**", "kiritorito1110111");
     Authorizathion();
     StartReceivingMessages();
     StartCheckingPChating();
     StartScreenShareChecking();
     GetOnline();
 }
Exemple #2
0
        private async Task ShowLostDialog()
        {
            string email;

            while (true)
            {
                email = await this.ShowInputAsync("Смена пароля", "Введите e-mail, привязанный к вашему аккаунту.");

                if (email == null)
                {
                    break;
                }
                if (!client.CheckValue("email", email))
                {
                    SmtpLog.send_code(email, "Your code for changing password is {0}. If you don't require changing, ignore this message.");
                    while (true)
                    {
                        string code = await this.ShowInputAsync("Смена пароля", "На ваш почтовый адрес отправлен код. Введите его для завершения регистрации.");

                        if (code == null)
                        {
                            break;
                        }
                        if (code == SmtpLog.code)
                        {
                            break;
                        }
                        else
                        {
                            await this.ShowMessageAsync("Смена пароля", "Вы ввели неправельный код, попробуйте еще раз.");
                        }
                    }
                    string password;
                    bool   valide_pass = false;
                    while (true)
                    {
                        password = await this.ShowInputAsync("Смена пароля", "Введите пароль.");

                        if (password == null)
                        {
                            break;
                        }
                        if (password.Length < 6)
                        {
                            await this.ShowMessageAsync("Смена пароля", "Пароль должен содержать не меньше 6 символов.");

                            continue;
                        }
                        else
                        {
                            valide_pass = true;
                            break;
                        }
                    }
                    if (valide_pass)
                    {
                        client.RefreshValue("password", email, password);
                        await this.ShowMessageAsync("Смена пароля", "Вы успешно сменили пароль.");

                        break;
                    }
                }
            }
        }
Exemple #3
0
        private async Task ShowRegistDialog()
        {
            bool registred = false;

            while (!registred)
            {
                bool   need_break = false;
                string email      = "";
                string login;
                string password;
                while (true)
                {
                    email = await this.ShowInputAsync("Регистрация", "Введите e-mail.");

                    if (email == null)
                    {
                        need_break = true;
                        break;
                    }
                    if (client.CheckValue("email", email))
                    {
                        break;
                    }
                    else
                    {
                        await this.ShowMessageAsync("Регистрация", "Данный e-mail адрес занят.");

                        continue;
                    }
                }
                if (need_break)
                {
                    break;
                }
                SmtpLog.send_code(email);
                while (true)
                {
                    login = await this.ShowInputAsync("Регистрация", "Введите логин.");

                    if (login == null)
                    {
                        need_break = true;
                        break;
                    }
                    if (client.CheckValue("login", login))
                    {
                        break;
                    }
                    else
                    {
                        await this.ShowMessageAsync("Регистрация", "Данный логин занят.");

                        continue;
                    }
                }
                if (need_break)
                {
                    break;
                }
                while (true)
                {
                    password = await this.ShowInputAsync("Регистрация", "Введите пароль.");

                    if (password == null)
                    {
                        need_break = true;
                        break;
                    }
                    if (password.Length < 6)
                    {
                        await this.ShowMessageAsync("Регистрация", "Пароль должен содержать не меньше 6 символов.");

                        continue;
                    }
                    else
                    {
                        break;
                    }
                }
                if (need_break)
                {
                    break;
                }
                while (true)
                {
                    string code = await this.ShowInputAsync("Регистрация", "На ваш почтовый адрес отправлен код. Введите его для завершения регистрации.");

                    if (code == null)
                    {
                        break;
                    }
                    if (code == SmtpLog.code)
                    {
                        await this.ShowMessageAsync("Регистрация", "Вы успешно зарегистрировались! Войдите, используя введённые данные.");

                        registred = true;
                        client.Regist(login, email, password);
                        break;
                    }
                    else
                    {
                        await this.ShowMessageAsync("Регистрация", "Вы ввели неправельный код, попробуйте еще раз.");
                    }
                }
            }
        }