public class VerifyCodeTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
VERIFY_CODES |
| Constructor and Description |
|---|
VerifyCodeTools() |
| Modifier and Type | Method and Description |
|---|---|
static String |
generateVerifyCode(int verifySize)
使用系统默认字符源生成验证码
|
static String |
generateVerifyCode(int verifySize,
String sources)
使用指定源生成验证码
|
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 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 - IOExceptionpublic static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException
w - h - os - verifySize - IOExceptionpublic static void outputImage(int w,
int h,
File outputFile,
String code)
throws IOException
w - h - outputFile - code - IOExceptionpublic static void outputImage(int w,
int h,
OutputStream os,
String code)
throws IOException
w - h - os - code - IOExceptionCopyright © 2019. All rights reserved.