首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用购买服务来处理Google captcha图片

如何使用购买服务来处理Google captcha图片
EN

Stack Overflow用户
提问于 2014-01-24 17:57:47
回答 1查看 122关注 0票数 0

我正面临一个问题,在谷歌验证码图像处理使用第三方服务。

但当我发送谷歌验证码图像URL到服务API。它会响应我下一个图像验证码。

谷歌验证码网址显示下一张图片在每次加载。

EN

回答 1

Stack Overflow用户

发布于 2014-01-24 18:15:06

在这个逻辑中,我发布了google验证码图片。捕获验证码图像并保存。

代码语言:javascript
复制
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

                            }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21329585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档