java³¬¼òµ¥,³¬¼¶ÊµÓÃÑéÖ¤Âë
1. ÑéÖ¤Âë(2)
dsnaValidateCode.jar
dsnaValidateCode_src.rar
ValidateCode.java ÑéÖ¤ÂëÉú³ÉÀà
Java´úÂë
package cn.dsna.util.images;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Random;
import javax.imageio.ImageIO;
/**
* ÑéÖ¤ÂëÉú³ÉÆ÷
* @author dsna
*
*/
public class ValidateCode {
// ͼƬµÄ¿í¶È¡£
private int width = 160;
// ͼƬµÄ¸ß¶È¡£
private int height = 40;
// ÑéÖ¤Âë×Ö·û¸öÊý
private int codeCount = 5;
// ÑéÖ¤Âë¸ÉÈÅÏßÊý
private int lineCount = 150;
// ÑéÖ¤Âë
private String code = null;
// ÑéÖ¤ÂëͼƬBuffer
private BufferedImage buffImg=null;
private char[] codeSequence = { 'A','B','C','D','E','F','G', 'H','I','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9'};
public ValidateCode() {
&n
Ïà¹ØÎĵµ£º
ÎÒ»Ò³£¼¦¶³£¬ACÁËÒ»¸ö188ÈËACµÄÌâÄ¿£¬¿ªÊ¼ËÀ»îRE£¬ÈÃÈ˲»½ûÄԲУ¬ÀíÂÛÉϰ´ÌâÄ¿ÃèÊö½ÓÊÕsplitµÄstringÊý×鿪µ½2×ã×ã¹»£¬µ«ÊÇHH´óÅ£»¹ÊÇÖ´×ŵÄÌá³öÁËÊý×éÔ½½çµÄ¿ÉÄÜ£¬ºóÀ´¿´ÄǸö´óСΪ5µÄÊý×éÓеãÌ«¸ðÀĘ̂£¬Ë÷ÐԸijÉ105(¿ÉÊÇÃ÷Ã÷2¸ö¾Í¹»Á˰¡£¬°¡£¬°¡£¬°¡£¬f**k)£¬È»ºó½»£ºAC£¬¿¿¡£ÄÔ²Ð+1£¬Ôôô¿ÉÄÜÄØ£¡ÄѵÀÌâÄ¿ÃèÊöÓÖÔÚÍæÈË£¬ ......
Òª¿ªÊ¼Ñ§Ï°JavaÁË
ÉùÃ÷£ºÒÔÏÂÊÇÎÒ×ªÔØµÄ£¬ÎÒ¾õµÃͦ²»´íµÄ ÄÃÀ´·ÖÏí¡£
j2eeµÄѧϰ˳Ðò
ÎÒÈÏΪj2eeÒ»¶¨ÒªÑÐò½¥½ø£¬ÎÒ×Ô¼º¾ÍÊÇÕâÑù£¬´ÓÒ»¸öÒ»°ã¸ßУ¼ÆËã»úϵ±ÏÒµ£¬
È»ºóÂú»³ÃÎÏëºÍ¼¤ÇéÈ¥ÕÒ¹¤×÷£¬ÎÒkao,ÄǸöµ¥Î»¶¼¸øÎÒ°×ÑÛ£¬Á¬»áÀϼҵÄÐͼÓÐÁË£¬ÄǸöʱºòºÍ¼¸¸ö¸çÃÇ£¬×¡ÔÚµØÏÂÊÒ£¨¾ÍÔÚ±±º½ÄÇÀ¡£»·¾³Ï൱¶ñÁÓ£¬Å® ......
ºÜ¶àÅóÓÑÔÚÉîÈëµÄ½Ó´¥JavaÓïÑÔºó¾Í»á·¢ÏÖÕâÑùÁ½¸ö´Ê£º·´ÉäºÍÄÚÊ¡£¬Ö®Ç°ÎÒÃÇÒѾͨ¹ýʵÀý½âÎöÁËJavaµÄ·´Éä»úÖÆ£¬ÔÚʲô³¡ºÏÏÂÓ¦ÓÃÒÔ¼°ÈçºÎʹÓ㿽ñÌì°ÑÕâ¶þÕß·ÅÔÚÒ»Æð½éÉÜ£¬ÒòΪËüÃǶþÕßÊÇÏศÏà³ÉµÄ¡£
·´Éä
Ïà¶Ô¶øÑÔ£¬·´Éä±ÈÄÚÊ¡¸üÈÝÒ×Àí½âÒ»µã¡£ÓÃÒ»¾ä±È½Ï°×µÄ»°À´¸ÅÀ¨£¬·´Éä¾ÍÊÇÈÃÄã¿ÉÒÔͨ¹ýÃû³ÆÀ´µÃµ½¶ÔÏó(À࣬ÊôÐÔ£ ......
ÕâÆªÎÄÕ²¢Ã»Óиø³öÈçºÎʹÓÃResultSetµÄ¾ßÌåÀý×Ó£¬Ö»ÊÇ´ÓResultSetµÄ¹¦ÄÜÐÔÉϽøÐÐÁËÏêϸµÄ½²Êö¡£Ï£ÍûÕâÆªÎÄÕ¶Դó¼ÒÀí½âResultSetÄܹ»ÓÐËù°ïÖú¡£ÏÂÃæ¾ÍÊÇÕâÆªÎÄÕµľßÌåÄÚÈÝ¡£
½á¹û¼¯(ResultSet)ÊÇÊý¾ÝÖвéѯ½á¹û·µ»ØµÄÒ»ÖÖ¶ÔÏ󣬿ÉÒÔ˵½á¹û¼¯ÊÇÒ»¸ö´æ´¢²éѯ½á¹ûµÄ¶ÔÏó£ ......
JAVAÏà¹Ø»ù´¡ÖªÊ¶
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ ......