예제 #1
0
        private async void FindPassword(string email)
        {
            try
            {
                pr_Load.Visibility = Visibility.Visible;
                SignM lm = new SignM()
                {
                    email = email,
                };
                string results = await WebClientClass.PostResults_Login(new Uri(" https://picaapi.picacomic.com/auth/forgot-password"), JsonConvert.SerializeObject(lm));

                LoginModel re = JsonConvert.DeserializeObject <LoginModel>(results);
                if (re.code == 200)
                {
                    messShow.Show("已發送", 3000);
                }
                else
                {
                    messShow.Show(re.message, 3000);
                    pr_Load.Visibility = Visibility.Collapsed;
                }
            }
            catch (Exception ex)
            {
                pr_Load.Visibility = Visibility.Collapsed;
                if (ex.HResult == -2147012867)
                {
                    messShow.Show("檢查你的網絡連接!", 3000);
                }
                else
                {
                    messShow.Show("發送失敗了,挂個VPN試試?", 3000);
                }
            }
        }
예제 #2
0
        private async void Sign(string email, string password, string name, string date, string gender)
        {
            try
            {
                pr_Load.Visibility = Visibility.Visible;
                SignM lm = new SignM()
                {
                    email    = email,
                    password = password,
                    birthday = date,
                    name     = name,
                    gender   = gender
                };
                string results = await WebClientClass.PostResults_Login(new Uri("https://picaapi.picacomic.com/auth/register"), JsonConvert.SerializeObject(lm));

                LoginModel re = JsonConvert.DeserializeObject <LoginModel>(results);
                if (re.code == 200)
                {
                    SettingHelper.Set_Email(email);
                    SettingHelper.Set_Password(password);
                    p_Login.Visibility      = Visibility.Visible;
                    p_Sign.Visibility       = Visibility.Collapsed;
                    l_txt_email.Text        = SettingHelper.Get_Email();
                    l_txt_password.Password = SettingHelper.Get_Password();
                    Login(l_txt_email.Text, l_txt_password.Password);
                }
                else
                {
                    messShow.Show(re.message, 3000);
                    pr_Load.Visibility = Visibility.Collapsed;
                }
            }
            catch (Exception ex)
            {
                pr_Load.Visibility = Visibility.Collapsed;
                if (ex.HResult == -2147012867)
                {
                    messShow.Show("檢查你的網絡連接!", 3000);
                }
                else
                {
                    messShow.Show("注冊失敗了,换个邮箱或挂個VPN試試?", 3000);
                }
            }
        }