Beispiel #1
0
        private CaptchaAnswerImage CaptureCaptchaImage()
        {
            DateTime dt   = DateTime.Now;
            var      uuid = KK.uuid();

            // 1. 验证码 - 提示语
            CoordRectangle rect1     = CoordRectangle.From(actionManager.AddDelta(442, 338), 380, 53);
            var            img01Path = string.Format("{0}\\{1}-{2:HHmmss}-p21.jpg", KK.CapturesDir(), uuid, dt);

            actionManager.CaptureImage(rect1, img01Path);

            // 2. 验证码 - 图形区域
            CoordRectangle rect2     = CoordRectangle.From(actionManager.AddDelta(445, 390), 230, 90);
            var            img02Path = string.Format("{0}\\{1}-{2:HHmmss}-p22.jpg", KK.CapturesDir(), uuid, dt);

            actionManager.CaptureImage(rect2, img02Path);

            CaptchaAnswerImage img = new CaptchaAnswerImage();

            img.Uuid        = uuid;
            img.CaptureTime = dt;
            img.ImagePath1  = img01Path;
            img.ImagePath2  = img02Path;

            return(img);
        }
Beispiel #2
0
        private CaptchaAnswerImage CaptureCaptchaImage()
        {
            DateTime dt   = DateTime.Now;
            var      uuid = KK.uuid();

            // 1. 验证码 - 提示语
            CoordRectangle rect1     = CoordRectangle.From(actionManager.AddDelta(442, 338), 380, 53);
            var            img01Path = KK.CapturesDir() + "\\" + uuid + "-" + dt.ToString("HHmmss") + "-p21.jpg";

            actionManager.CaptureImage(rect1, img01Path);

            // 2. 验证码 - 图形区域
            CoordRectangle rect2     = CoordRectangle.From(actionManager.AddDelta(445, 390), 230, 90);
            var            img02Path = KK.CapturesDir() + "\\" + uuid + "-" + dt.ToString("HHmmss") + "-p22.jpg";

            actionManager.CaptureImage(rect2, img02Path);

            CaptchaAnswerImage img = new CaptchaAnswerImage();

            img.Uuid        = uuid;
            img.CaptureTime = dt;
            img.ImagePath1  = img01Path;
            img.ImagePath2  = img02Path;

            return(img);
        }
Beispiel #3
0
 private void InitBizDir()
 {
     FileUtils.CreateDir(KK.CapturesDir());
     FileUtils.CreateDir(KK.FlashScreenDir());
 }