Esempio n. 1
0
        /// <summary>
        /// 获取验证码
        /// </summary>
        private async Task GetCaptchaCodeAsync()
        {
            var captchaCodeResult = await OfoWebApiService.Current.GetCaptchaCodeAsync();

            if (captchaCodeResult.IsSuccess)
            {
                VerifyId = captchaCodeResult.Data.VerifyId;
                using (var imgStream = await AccessStreamUtility.GetRandomAccessStreamFormBase64String(captchaCodeResult.Data.CaptchaStr))
                {
                    await DispatcherHelper.RunAsync(() =>
                    {
                        VerifyCodeImage.SetSource(imgStream);
                    });
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取验证码
        /// </summary>
        private async Task GetCaptchaCodeAsync()
        {
            //VerifyCodeImage = VerifyCodeImage ?? new BitmapImage();
            //OfoApi.CurUser.TelPhone = TelPhone;
            var captchaCodeResult = await OfoApi.GetCaptchaCodeAsync();

            if (await CheckOfoApiResultHttpStatus(captchaCodeResult))
            {
                VerifyId = captchaCodeResult.Data.VerifyId;
                using (var imgStream = await AccessStreamUtility.GetRandomAccessStreamFormBase64String(captchaCodeResult.Data.CaptchaStr))
                {
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
                    {
                        VerifyCodeImage.SetSource(imgStream);
                    });
                }
            }
        }