易截截图软件、单文件、免安装、纯绿色、仅160KB

java实现验证码

java验证码的实现(一)
收藏



1.ImageServlet类的实现:
package com.mobile.control;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ImageServlet extends HttpServlet {
       public void doGet(HttpServletRequest request,
HttpServletResponse response)
                     throws ServletException, IOException {
              this.doPost(request, response);
       }
       // 生成数字和字母的验证码
       public void doPost(HttpServletRequest request,
HttpServletResponse response)
                     throws ServletException, IOException {
              BufferedImage img = new BufferedImage(68, 22,
                            BufferedImage.TYPE_INT_RGB);
              // 得到该图片的绘图对象
              Graphics g = img.getGraphics();
              Random r = new Random();
&


相关文档:

Java 调用EXE

使用Runtime.getRuntime().exec()方法可以在java程序里运行外部程序.  
  该方法有6个可访问版本:  
  1.exec(String   command)  
  2.exec(String   command,   String   envp[],   File   dir)    
  3.exec(String   cmd, &n ......

java读取xml配置文件

xml文件如下 配置功能开关
<Configurations>
    <Samples>true</Samples>
    <Excepts>true</Excepts>
    <CheckFace>false</CheckFace>
    <ThumbNail>false</ThumbNail>
  &nbs ......

C/C++与Java函数重载区别!

#include <iostream>
using namespace std;
class Base {
public:
virtual void fn(int x) {
cout << "In Base class, int x = " << x << endl;
}
};
class SubClass : public Base {
public:
// 函数的重载,这样的重载方式,在Java中能行,在C/C++中却不行
virt ......

excel java 实例

POIFSFileSystem fs=new POIFSFileSystem(new   FileInputStream(cfname));  
                 HSSFWorkbook   wb   =   new   HSSFWorkbook(fs);  
  ......

JAVA清除html格式正则表达式


 public static String splitAndFilterString(String input, int length) {   
        if (input == null || input.trim().equals("")) {   
     &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号