public class VerifyCodeUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
VerifyCodeUtils.Verify
验证码对象
|
Modifier and Type | Field and Description |
---|---|
static String |
VERIFY_CODES |
Constructor and Description |
---|
VerifyCodeUtils() |
Modifier and Type | Method and Description |
---|---|
static VerifyCodeUtils.Verify |
generateVerify()
使用系统默认字符源生成验证码
|
static String |
generateVerifyCode(int verifySize)
使用系统默认字符源生成验证码
|
static String |
generateVerifyCode(int verifySize,
String sources)
使用指定源生成验证码
|
static void |
main(String[] args) |
static void |
outputImage(int w,
int h,
File outputFile,
String code)
生成指定验证码图像文件
|
static void |
outputImage(int w,
int h,
OutputStream os,
String code)
输出指定验证码图片流
|
static String |
outputVerifyImage(int w,
int h,
File outputFile,
int verifySize)
生成随机验证码文件,并返回验证码值
|
static String |
outputVerifyImage(int w,
int h,
OutputStream os,
int verifySize)
输出随机验证码图片流,并返回验证码值
|
public static final String VERIFY_CODES
public static VerifyCodeUtils.Verify generateVerify()
verifySize
- 验证码长度public static String generateVerifyCode(int verifySize)
verifySize
- 验证码长度public static String generateVerifyCode(int verifySize, String sources)
verifySize
- 验证码长度sources
- 验证码字符源public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException
w
- h
- outputFile
- verifySize
- IOException
public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException
w
- h
- os
- verifySize
- IOException
public static void outputImage(int w, int h, File outputFile, String code) throws IOException
w
- h
- outputFile
- code
- IOException
public static void outputImage(int w, int h, OutputStream os, String code) throws IOException
w
- h
- os
- code
- IOException
public static void main(String[] args) throws IOException
IOException
Copyright © 2019. All rights reserved.