Exemple #1
0
        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <returns></returns>
        public async Task <BitmapImage> GetCaptchaAsync()
        {
            var stream = await BiliClient.GetStreamFromWebAsync($"{Api.PASSPORT_CAPTCHA}?ts=${BiliFactory.GetNowSeconds()}");

            if (stream != null)
            {
                var bitmap = new BitmapImage();
                bitmap.BeginInit();
                bitmap.StreamSource = stream;
                bitmap.BeginInit();
                return(bitmap);
            }
            return(new BitmapImage(new Uri("ms-appx:///Assets/captcha_refresh.png")));
        }