Java验证码库 iCaptcha

Apache
Java
跨平台
2010-05-21
红薯

iCaptcha 是一个 Java 的验证码库,支持国际化和可定制。

示例代码:

//Optional Properties
Properties props = new Properties();
props.put("format", "jpg");
props.put("font", "Helvetica");
props.put("fontsize", "28");
props.put("min-width", "180");
props.put("padding-x", "25");
props.put("padding-y", "25");
OutputStream os = new FileOutputStream("c:/captcha/text.jpg");
FactoryLanguageImpl inst=(FactoryLanguageImpl)Producer.forName("org.smx.captcha.impl.FactoryLanguageImpl");
inst.setLanguageDirectory("C:/captcha/lang");
inst.setLanguage("RU");
inst.setRange(5, 10); //Select words between 5-10 letters
Producer.render(os, inst, props);

加载中

评论(0)

暂无评论

暂无资讯

暂无问答

暂无博客

返回顶部
顶部