3、验证码工具
@Test
public void hutoolCodeTest() throws FileNotFoundException {
/**、
-
1、创建一个验证码:
-
验证码 captcha['kæptʃə]
-
line:线条
-
参数说明
-
width:宽度
-
height:高度
-
codeCount:字符数量
-
lineCount:干扰线数量
*/
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 40, 4, 4);
//2.获得生成的验证码的真实码值
String code = lineCaptcha.getCode();
System.out.println(code);
//3.将验证码图片输出到D盘根目录下
lineCaptcha.write(new FileOutputStream(“D:/text.png”));
}
4、excel工具
- POI依赖导入,否则报错
You need to add dependency of 'poi-ooxml' to your project, and version >= 3.17
org.apache.poi
poi-ooxml
3.17
org.apache.poi
poi-ooxml-schemas
3.17
(1)Exel导出
@Test
public void HutollDownLoadExcelTest() throws FileNotFoundException {
//1.创建一个Excel写出工具Writer
ExcelWriter writer = ExcelUtil.getWriter(true);
//2.模拟List数据
List list = new ArrayL