[英]How to handle Google captcha image using purchase service for handle captcha
我在使用第三方服務的Google驗證碼圖像句柄中遇到問題。
但是,當我將Google驗證碼圖片網址發送給服務API時。 下一個圖像驗證碼會回應我。
Google驗證碼網址會在每次加載時顯示下一張圖片。
按照這種邏輯,我張貼谷歌驗證碼圖像。 捕獲驗證碼圖像並保存。
protected function captchaLoadComplete():void
{
var fileStream:FileStream = new FileStream();
enter code here
// Capture captcha image
var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(WBCaptcha);
// Encode captcha image into JPEG format
var oJpg:JPEGEncoder = new JPEGEncoder();
var data:ByteArray = oJpg.encode(imageBitmapData);
// *** Here load the captcha image in MAC os ***
if((Capabilities.os.indexOf("Mac") >= 0))
{
//*** Save the downloaded file without generate browser popup ***
fileStream.open(new File(File.applicationStorageDirectory.nativePath+"/temp.jpg"),FileMode.WRITE);
fileStream.writeBytes(data, 0, data.length);
}else if((Capabilities.os.indexOf("Windows") >= 0))
{
// Save the Capture image without generate browser popup
fileStream.open(new File(File.applicationStorageDirectory.nativePath+"\\temp.jpg"),FileMode.WRITE);
fileStream.writeBytes(data, 0, data.length);
// load Capture image in window os
imgCaptcha.source = File.applicationStorageDirectory.nativePath +"\\"+ "temp.jpg";
}
timerforLoadPage = new Timer(5000, 0);
timerforLoadPage.addEventListener(TimerEvent.TIMER, imageLoadComplete);
timerforLoadPage.start(); // Start timer
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.