下载此文档

JSP彩色验证码 字母 数字.doc


文档分类:IT计算机 | 页数:约4页 举报非法文档有奖
1/4
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/4 下载此文档
文档列表 文档介绍
<%***@pagecontentType="image/jpeg"import=".*,.*,.*,.*"pageEncoding="UTF-8"%><%!etRandColor(intfc,intbc){//给定范围获得随机颜色Randomrandom=newRandom();if(fc>255)fc=255;if(bc>255)bc=255;intr=fc+(bc-fc);intg=fc+(bc-fc);intb=fc+(bc-fc);returnnewColor(r,g,b);}%><%//("Pragma","No-cache");("Cache-Control","no-cache");("Expires",0);//在内存中创建图象intwidth=80,height=20;BufferedImageimage=newBufferedImage(width,height,);//获取图形上下文Graphicsg=();//生成随机类Randomrandom=newRandom();//(getRandColor(200,250));(0,0,width,height);//(newFont("TimesNewRoman",,18));//(newColor(0,0,0));(0,0,width-1,height-1);//随机产生155条干扰线,(getRandColor(160,200));for(inti=0;i<155;i++){intx=(width);inty=(height);intxl=(12);intyl=(12);(x,y,x+xl,y+yl);}//取随机产生的认证码(4位数字)StringsRand="";for(inti=0;i<4;i++){Stringrand=null;//随机生成数字或者字母if((10)>5){rand=((char)((10)+48));}else{rand=((char)((26)+65));}sRand+=rand;//(newColor((80),(80),(80)));//调用函数出来

JSP彩色验证码 字母 数字 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数4
  • 收藏数0 收藏
  • 顶次数0
  • 上传人drp539609
  • 文件大小24 KB
  • 时间2019-10-18
最近更新