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

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

于 2022-03-03 发布 文件大小:1.57 kB
0 41
下载积分: 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 个回复

  • Java做的简单的图片抓取程序
    Java做的简单的图片抓取程序 要用到几JAR包,链接地址如下:  http://jsoup.org/packages/jsoup-1.7.2.jar  apache的commons-io相关jar包
    2022-03-21 11:27:59下载
    积分:1
  • 使用Java和sql开发的固定资产管理系统!
    使用Java和sql开发的固定资产管理系统!-sql use Java and the development of the fixed assets management system.
    2022-07-26 16:04:57下载
    积分:1
  • AdpmWebService
    一个简单的关于webservice例子,很具有参考简直(a singer webservice)
    2011-12-13 09:47:05下载
    积分:1
  • (1.01)这一目前纯java软件的数据操作,将支持Oracle和…
    SqlPlus(1.01) 这是一个纯JAVA的数据操作软件,目前能支持ORACLE及SQL SERVER。能同时打开多个不同数据库的连接,并支持语法检查及关键字加亮。 本软件有较好UI界面,特别适合需要使用多种数据库的开发人员使用。 本软件开放源码,结构虽然不是很清晰,但比较适合JAVA初学者学习,希望网友们能和我一起完善它。-SqlPlus (1.01) This a pure Java software data operation, will support Oracle and SQL Server. Open at the same time a number of different database connectivity, and support for syntax checking and keyword highlighting. The software has a better UI interface, especially for the use of multiple database developers to use. The open-source software, although the structure is not very clear, but more suitable for beginners to learn Java, netizens will be able to join me perfect.
    2022-03-24 16:47:35下载
    积分:1
  • java dynamic graphics
    java动态绘图-java dynamic graphics
    2022-01-27 10:37:36下载
    积分:1
  • 顺丰快递BSP接口demo
    顺丰快递BSP接口demo,java代码。HTTP/POST模式的下单demo代码
    2022-03-21 15:09:23下载
    积分:1
  • tut-rest-master
    You re creating an API that clients need to consume across the web. You want to open up your organization s data to consumption by varied clients across the web. You need to integrate your application with other applications inside your own organization, but you don t have control over the languages, tools, or frameworks for those applications.
    2014-03-18 11:30:50下载
    积分:1
  • 在医疗管理系统java
    onnline医疗管理系统检查。
    2022-04-08 22:27:51下载
    积分:1
  • Frank-Wolfe
    Frank-Wolfe算法的实现,给出小网络为例子进行验证。(Frank-Wolfe algorithm to verify that the small network is given as an example.)
    2012-04-15 15:38:59下载
    积分:1
  • 一个JAVA编写的俄罗斯方块
    一个JAVA编写的俄罗斯方块-a sheet prepared by the Russian
    2022-08-15 05:50:43下载
    积分:1
  • 696518资源总数
  • 104292会员总数
  • 28今日下载