登录
首页 » java » java版验证码(数字字母大小写字体字号颜色均任意变化)

java版验证码(数字字母大小写字体字号颜色均任意变化)

于 2022-03-03 发布 文件大小:1.57 kB
0 124
下载积分: 2 下载次数: 1

代码说明:

import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; import java.util.Random; import javax.imageio.ImageIO; public class VerifyCode { private int w = 70; private int h = 35; private Random r = new Random(); // {"宋体", "华文楷体", "黑体", "华文新魏", "华文隶书", "微软雅黑", "楷体_GB2312"} private String[] fontNames = {"宋体", "华文楷体", "黑体", "微软雅黑", "楷体_GB2312"};//可选字体 private String codes = "23456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ";//可选字符 private Color bgColor = new Color(255, 255, 255);//背景颜色 private String text ;//验证码上的字符 //生成随机的颜色 private Color randomColor () { int red = r.nextInt(150); int green = r.nextInt(150); int blue = r.nextInt(150); return new Color(red, green, blue); } //生成随机的字体 private Font randomFont () { int index = r.nextInt(fontNames.length); Stri

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • ssi
    简单的ibaits应用,与spring struts结合(Simple ibaits applications, combined with spring struts)
    2013-01-18 09:17:19下载
    积分:1
  • Simple Entry Staff
    这是关于如何输入数据的源代码,工作人员与照片,并已登录到访问此管理局。
    2022-01-25 19:34:07下载
    积分:1
  • java实现常见算法,包括KMP,模式匹配。DFS,动态规划,迭代排序算法等
    java实现常见算法,包括KMP,模式匹配。DFS,动态规划,迭代,,堆排序,图搜索,数搜索等等
    2022-12-15 22:45:03下载
    积分:1
  • High performance in multipoint system using PVSN approach
    最近,有一个
    2022-12-12 15:20:03下载
    积分:1
  • Minesweeper
    扫雷游戏,实现了基本的游戏的功能,界面比金典扫雷游戏的更美观,而且,图片很好看呀(Minesweeper, realize the basic function of the game, than the golden interface minesweeper more beautiful, and the pictures are good ah)
    2012-05-26 22:00:07下载
    积分:1
  • LineReader
    A class for reading lines of text. Provides the same functionality.
    2014-02-17 11:35:04下载
    积分:1
  • 推箱子VTM越南,这是源代码
    Sokoban VTM Vietnam, this is source code
    2022-09-22 05:10:03下载
    积分:1
  • VirtualTestTarget
    Annotation for "virtual" implementation classes. These are classes that have the following attributes:.
    2013-12-05 10:45:00下载
    积分:1
  • java 地图使用 JMapViewer
    这是一个演示为 JMapViewer,导入 JMapViewer 将修复独立性错误。该示例演示如何使用 JMapViewer 来在您的桌面应用程序中显示打开街道地图 !
    2022-01-22 14:18:47下载
    积分:1
  • DMS数据采集系统
    这是java开发的一款DMS数据采集系统,它使用IO流进行存取数据,用socket原理进行通信
    2022-07-20 02:57:33下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载