flexºÍjava×öµÄͼƬÉÏ´«µÄСÀý×Ó
ÓõÄÊÇCommonsÉÏ´«×é¼þ£¬ÏÂÔصØÖ·£ºCommons
ÍøÉÏÕÒµÄСÀý×Ӹĵģ¬ÐÞ¸ÄÁ˲¿·Ö´íÎó¡£
1£¬FileUpload.java
package com.fileupload;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
public class FileUpload extends HttpServlet {
// ÏÞÖÆÎļþµÄÉÏ´«´óС
private int maxPostSize = 100 * 1024 * 1024;
public FileUpload() {
super();
}
public void destroy() {
super.destroy();
}
protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
System.out.println("¿ªÊ¼!");
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setSizeThreshold(4096);
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax(maxPostSize);
try {
request.setCharacterEncoding("UTF-8");
List fileItems = upload.parseRequest(request);
Iterator iter = fileItems.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (!item.isFormField()) {
String name = item.getName();
System.out.println(name);
String uploadPath = null;
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
uploadPath = request.getRealPath("/");
System.out.println(uploadPath);
item.write(new File(uploadPath +"uploadfile/"+ name));
out.print(name+"ÉÏ´«³É¹¦");
}
}
} catch (FileUploadException e) {
e.printStackTrace();
}
System.out.println("½áÊø");
}
prot
Ïà¹ØÎĵµ£º
Flex Alert×é¼þʹÓ÷½·¨£¬Í¨¹ýAlert.show(......)·½·¨µ÷ÓÃ
¡¡¡¡Alert.show(content,title,flags,parent,closeHandle,iconClass,defaultButtonFlag);
¡¡¡¡Flex Alert×é¼þÄÚÈÝ
¡¡¡¡Content:ÌáʾÄÚÈÝ
¡¡¡¡title:Ìáʾ¿ò±êÌâ
¡¡¡¡flags:Ö¸¶¨³öÏֵİ´Å¥
¡¡¡¡0--OK°´Å¥£¬
¡¡¡¡1--Yes°´Å¥
¡¡¡¡2--No°´Å¥
¡¡¡¡3--Yes,No°´Å¥ ......
ÔÚÏîÄ¿Öо³£»áÓöµ½Ê¹ÓÃCSVÎļþ£¬±ÈÈç´ÓHRÖеõ½µÄÎļþÄõ½ÆäËüµØ·½È¥´¦Àí£¬Êµ¼Ê»áÐèÒªµÃµ½µ±Ç°ºÍÉÏ´ÎÎļþÖеIJîÒ죬±ÈÈ磺Ìí¼Ó£¬É¾³ý£¬Ð޸ģ¬ ÄÇôÈçºÎÀ´ÊµÏÖÄØ£¬¿ÉÄÜÓкܵķ½·¨£¬ÔÚÕâÀïÎÒ˵һÏÂÎÒµÄʵÏÖ·½·¨¶øÇÒÒÑͶÈëʵ¼ÊʹÓá£
Ê×ÏÈ£¬ CSVÎļþµäÐÍÒÔ,·Ö¸ô£¬µ±È»»¹ÓÐÆäËüµÄ×Ö·û£¬ÓɺܶàÁеÄÊôÐÔºÍÊôÐÔÖµ×é³É£¬ÄÇôÁ½¸öÎ ......
1¡¢¶ÔÏóÊÇ°´ÒýÓô«µÝµÄ---´ø"="ºÅµÄ¸³Öµ²Ù×÷
2¡¢Java Ó¦ÓóÌÐòÓÐÇÒ½öÓеÄÒ»ÖÖ²ÎÊý´«µÝ»úÖÆ£¬¼´°´Öµ´«µÝ---ÓÉ"º¯Êýµ÷ÓÃ"ÒýÆðµÄ
3¡¢°´Öµ´«µÝÒâζ×ŵ±½«Ò»¸ö²ÎÊý´«µÝ¸øÒ»¸öº¯Êýʱ£¬º¯Êý½ÓÊÕµÄÊÇÔʼֵµÄÒ»¸ö¸±±¾
4¡¢°´ÒýÓô«µÝÒâζ×ŵ±½«Ò»¸ö²ÎÊý´«µÝ¸øÒ»¸öº¯Êýʱ£¬º¯Êý½ÓÊÕµÄÊÇÔʼֵµÄÄÚ´æµØÖ·£¬¶ø²»ÊÇÖµ µÄ¸±±¾
5¡¢×¢ ......
ÔÚjava.math°üÖÐÓиöBigDecimalÀ࣬ͨ¹ýÕâ¸öÀà¿ÉÒÔ½øÐо«È·¼ÆËã. ÎÒÃÇÖªµÀBigDecimalÓиösetScale(int ¾«¶È,int ÉáÈëģʽ)·½·¨£¬ËæÖ®¶øÀ´ÎÊÌâ³öÏÖÁË£¬µ±ÔËÐÐÈçÏ´úÂëʱ£º
/**
* @author troy(J2EE)
* @version 1.0
*/
import java.math.*;
public class Test{
& ......
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
/**
ÎļþÃû£ºFileEncrypter.java
JDK£º1.40ÒÔÉÏ
˵Ã÷£ºÎļþ¼ÓÃÜ
¼ÓÃÜ·½·¨£ºÈýÖØDES¼ÓÃÜ
¼ÓÃܹý³Ì£º¶ÔÑ¡ÖеÄÎļþ¼ÓÃܺóÔÚͬÎļ ......