Java统合运用
文章平均质量分 55
iteye_4255
这个作者很懒,什么都没留下…
展开
-
生成一维码 条码
import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import org.apache.avalon.framework.c...原创 2011-05-17 17:31:11 · 226 阅读 · 0 评论 -
base64加密解密
/** * */ package com.wuhongbo.common.util.encry; import java.io.IOException; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; /** * Base64加密 * * @author wuhongbo...原创 2012-11-18 16:06:42 · 76 阅读 · 0 评论 -
DOM4J XML解析和组合
package com.wuhongbo.common.util.xml; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.util.List; import org.dom4j.Document; im...原创 2012-10-31 18:02:05 · 102 阅读 · 0 评论 -
java 写Excel工具类
public static void main(String[] args) { File template = new File("c:/excel/t.xls"); File targer = new File("c:/excel/t_" + new Date().getTime() + ".xls"); try { ExcelWrite excel...原创 2013-09-06 19:50:36 · 80 阅读 · 0 评论 -
java mail 支持text、html正文,多附件,发送、抄送、密送均多人
测试代码,详情代码在email.rar目录,需要用到以下2个包,j2ee5会说找一个一个类。可以用j2ee4 public static void main(String[] args) throws Exception { MailBean mail = new MailBean("hongbo.wu@qq.com", "****", "smtp.qq.com", ...原创 2013-08-28 14:05:41 · 190 阅读 · 0 评论 -
java MD5加密码
/** * */ package com.wuhongbo.common.util.encry; import java.security.MessageDigest; /** * MD5加密 * * @author wuhongbo */ public class MD5Util { private final static char hexD...原创 2012-06-08 16:28:21 · 111 阅读 · 0 评论 -
Zxing2.2 生成QR二维码和一维码(条码)
在http://code.google.com/p/zxing/downloads/list下载zxing压缩包Zxing-2.2, 使用core包 代码如下: package cn.wuhongbox.common.javaQR; import java.awt.image.BufferedImage; import java.io.File; import java....原创 2013-06-03 17:56:42 · 361 阅读 · 0 评论 -
Zxing二维码 QR_CODE
在http://code.google.com/p/zxing/downloads/list下载zxing压缩包Zxing-1.5, 使用core与javase包 代码如下: 解析中文时注意修改 编码方式 package cn.wuhongbox.javaQR; import java.awt.image.BufferedImage; import java.io.Fi...原创 2011-05-17 16:22:54 · 117 阅读 · 0 评论 -
ASCII转字符 字符转ASCII 十进制转其它进制
public static void main(String[] args) { String s="a"; int tmp =s.hashCode(); System.out.println((int)s.charAt(0)); int x =65; System.out.println((char)x); ...原创 2012-07-12 16:07:54 · 374 阅读 · 0 评论 -
Java读Excel
import java.io.File; import jxl.Cell; import jxl.CellType; import jxl.DateCell; import jxl.LabelCell; import jxl.NumberCell; import jxl.Sheet; import jxl.Workbook; public class Test { ...原创 2011-08-10 11:24:40 · 66 阅读 · 0 评论 -
Struts2文件上传
页面上传名称为 upload 提交表单方式为Post 类型为multipart/form-data , 如下 method="post" enctype="multipart/form-data" // 文件上传 upload 注意生成get/set方法 private File upload; private String uploadContentType; // 文件的内容...原创 2011-08-10 10:08:27 · 60 阅读 · 0 评论 -
java 访问私有属性的值
public static void main(String[] args)throws Exception { Model m =new Model(); m.setUid("uid123"); m.setPwd("pwd888"); Field[] fields = m.getClass().getDeclaredFields(); for (Fiel...原创 2011-06-24 10:34:48 · 429 阅读 · 0 评论 -
java注解例子
定义注解 import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.F...原创 2011-05-19 11:12:02 · 106 阅读 · 0 评论 -
AES加密解密
package com.wuhongbo.common.util.encry; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import...原创 2012-11-18 16:07:43 · 96 阅读 · 0 评论