Ejemplo n.º 1
0
        /// <summary>
        /// Get and activate the QR code
        /// </summary>
        /// <returns>BitmapImage containing the QR code</returns>
        public async Task <Image> GetQRCodeAsync()
        {
            string getResult = await netHandler.GETRequestAsync(jsLoginURL);

            NetworkHandler.ReadUntil(ref getResult, "uuid");
            NetworkHandler.ReadUntil(ref getResult, "\"");
            string uuid      = NetworkHandler.ReadUntil(ref getResult, "\"");
            string qrCodeURL = "https://login.weixin.qq.com/qrcode/" + uuid;
            Image  qrCode    = await netHandler.GETRequestAsImageAsync(qrCodeURL);

            qrStatusURL   = "https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=" + System.Net.WebUtility.UrlEncode(uuid);
            qrCodeScanned = false;
            WaitUntilScanned();
            return(qrCode);
        }