Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ͨ¹ýJava¼¸ÐдúÂë½ØÈ¡ÆÁÄ»

ͨ¹ýjava.awt.RobotµÄcreateScreenCapture½ØÆÁ¡£
    public static void captureScreen(String fileName) throws Exception {
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Rectangle screenRectangle = new Rectangle(screenSize);
    Robot robot = new Robot();
    BufferedImage image = robot.createScreenCapture(screenRectangle);
    ImageIO.write(image, "png", new File(fileName));
    }


Ïà¹ØÎĵµ£º

Flex Compile Error: Error: Java heap space

ÓÉÓÚFlex Builder compiler shellÓÐmemory leakµÄÎÊÌ⣬ ¶øSDKĬÈÏµÄµÄ JVM heap size Ö»ÓÐ312M£¬µ±compile±È½Ï´óµÄprojectÈÝÒײ»¹»£¬ËùÒÔÖ»ÒªÐÞ¸ÄSDKµÄJVM²ÎÊý¾Í¿ÉÒÔ¡£
±à¼­ {Flex SDK}/bin/jvm.config ÎļþÈçÏ¡£
java.args=-Xmx512m ...
Èç¹û»¹ÊÇÓÐError£¬¿ÉÒÔÔö¼Óµ½1024»òÕ߸ü¶à¡£ ......

JAVA¼ÓÃÜËã·¨»ã×ÜÒ»

1. MD5¼ÓÃÜ£¬³£ÓÃÓÚ¼ÓÃÜÓû§ÃûÃÜÂ룬µ±Óû§Ñé֤ʱ¡£
¡¡ ¡¡protected byte[] encrypt(byte[] obj) ...{
¡¡¡¡try ...{
¡¡¡¡MessageDigest md5 = MessageDigest.getInstance("MD5");
¡¡¡¡md5.update(obj);
¡¡¡¡return md5.digest();
¡¡¡¡} catch (NoSuchAlgorithmException e) ...{
¡¡¡¡e.printStackTrace();
¡ ......

ËĸöÓÐÓõÄJava¹ýÂËÆ÷

Ò»¡¢Ê¹ä¯ÀÀÆ÷²»»º´æÒ³ÃæµÄ¹ýÂËÆ÷     
import javax.servlet.*;    
import javax.servlet.http.HttpServletResponse;    
import java.io.IOException;    
   
/**   
* ÓÃÓÚµÄʹ Browser ²» ......

Java¹ýÂËÆ÷ÑéÖ¤µÇ¼Óû§

1.Ê×ÏÈдһ¸öȨÏÞ¹ýÂËfilterÀà,ʵÏÖFilter½Ó¿Ú
/*Ê×ÏÈдһ¸öȨÏÞ¹ýÂËfilter*/
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import ......

JavaÏß³Ìͬ²½Ê¾Àý

ÎÄÕÂÓÃʵÀý´úÂëչʾÁËJavaÖжàÏ̷߳ÃÎʹ²Ïí×ÊÔ´
ʱÏß³Ìͬ²½
µÄÖØÒªÐÔ¡£
·Ö±ðͨ¹ýÔÚÁ½¸öÏß³ÌÖÐͬʱ·ÃÎÊ(µ÷ÓÃget_id*·½·¨)¾­¹ýͬ²½´¦Àí(lock¼°Synchronized)µÄ¹²Ïí×ÊÔ´(tmp)¼°Î´¾­¹ýͬ²½´¦ÀíµÄ¹²Ïí×ÊÔ´(tmp)À´ËµÃ÷ͬ²½´¦ÀíµÄµÄ×÷Óá£
mainÖзÖÁ½²¿·Ö:
1£©Ç°°ë²¿·Ö£¬non-synchronization²¿·ÖÓÃÀ´²âÊÔûÓÐ×öͬ²½´¦ÀíµÄ´úÂë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ