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

¡¾Ëæ±Ê¡¿java ÐéÄâ°´¼ü

import java.awt.Robot;
import java.io.IOException;
import java.lang.reflect.Field;
public class TestServer {
Class<?> key;
Robot ro;
{//·Ç¾²Ì¬¿éÓÃÓÚ³õʼ»¯ÀàÀàµÄ·Ç¾²Ì¬³ÉÔ±
try {
key = Class.forName("java.awt.event.KeyEvent");
ro = new Robot();
}
catch (Exception e) {}
}

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws Exception {
TestServer ts = new TestServer();
Thread.sleep(2000);
ts.pressLots("testwderetestwderewwer123wwer123");
}

/**
* singleKey
* @param k singleKey
* @throws Exception
*/
private void singleKeyPress (String k) throws Exception{
Field fi = key.getField("VK_" + k.toUpperCase());
ro.keyPress(fi.getInt(null));
ro.keyRelease(fi.getInt(null));
}

/**
* string print
* @param arg
*/
private void pressLots (String ... arg) throws Exception {
int iat = -1;
while (iat++ < arg[0].length()-1)
singleKeyPress(String.valueOf(arg[0].charAt(iat)));
}
}


Ïà¹ØÎĵµ£º

JavaÖм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

Java±à³ÌËöÊ£¨9£©——Êý¾Ý¿âÁ¬½Ó³Ø


Ò»¡¢Êý¾Ý¿âÁ¬½Ó³Ø¹¤×÷Ô­Àí£º
1.         ¶ÔÓÚ¹²Ïí×ÊÔ´£¬ÓÐÒ»¸öºÜÖøÃûµÄÉè¼Æģʽ£º×ÊÔ´³Ø£¨Resource Pool£©¡£¸ÃģʽÕýÊÇΪÁ˽â¾ö×ÊÔ´µÄƵ·±·ÖÅä﹑ÊÍ·ÅËùÔì³ÉµÄÎÊÌ⡣Ϊ½â¾öÉÏÊöÎÊÌ⣬¿ÉÒÔ²ÉÓÃÊý¾Ý¿âÁ¬½Ó³Ø¼¼Êõ¡£Êý¾Ý¿âÁ¬½Ó³ØµÄ»ù±¾Ë¼Ïë¾ÍÊÇΪÊý¾Ý¿âÁ¬½Ó½¨Á¢Ò»¸ö“»º³ ......

javaÒì³£´¦Àí£¨1£©

Äã¾õµÃ×Ô¼ºÊÇÒ»¸öJavaר¼ÒÂð£¿ÊÇ·ñ¿Ï¶¨×Ô¼ºÒѾ­È«ÃæÕÆÎÕÁËJavaµÄÒì³£´¦Àí»úÖÆ£¿ÔÚÏÂÃæÕâ¶Î´úÂëÖУ¬ÄãÄܹ»Ñ¸ËÙÕÒ³öÒì³£´¦ÀíµÄÁù¸öÎÊÌâÂð£¿
OutputStreamWriter out = ...
java.sql.Connection conn = ...
try { // ¢É
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery(
"selec ......

ÔËÓüÓÃܼ¼Êõ±£»¤JavaÔ´´úÂë

ÔËÓüÓÃܼ¼Êõ±£»¤JavaÔ´´úÂë    
   
ÄÚÈÝ£º 
 
Ò»¡¢ÎªÊ²Ã´Òª¼ÓÃÜ£¿ 
¶þ¡¢¶¨ÖÆÀà×°ÈëÆ÷  

Èý¡¢¼ÓÃÜ¡¢½âÃÜ 
ËÄ¡¢Ó¦ÓÃʵÀý 
Îå¡¢×¢ÒâÊÂÏî 
²Î¿¼×ÊÔ´ 
Java³ÌÐòµÄÔ´´úÂëºÜÈÝÒ×±»±ðÈË
͵¿´¡£Ö»ÒªÓÐÒ»¸ö·´±àÒëÆ÷£¬ÈκΠ......

Thinking in Java Ö®String ÕýÔò±í´ïʽ

       Ê²Ã´ÊÇÕýÔò±í´ïʽ£¿
       ÕýÔò±í´ïʽÊÇÒ»ÖÖÇ¿´ó¶øÁé»îµÄÎı¾´¦Àí¹¤¾ß¡£Ê¹ÓÃÕýÔò±í´ïʽ£¬ÎÒÃÇÄܹ»ÒÔ±à³ÌµÄ·½Ê½£¬¹¹Ô츴ÔÓµÄÎı¾Ä£Ê½£¬²¢¶ÔÊäÈëµÄ×Ö·û´®½øÐÐËÑË÷¡£Ò»µ©ÕÒµ½ÁËÆ¥ÅäÕâЩģʽµÄ²¿·Ö£¬Äã¾ÍÄܹ»ËæÐÄËùÓûµØ¶ÔËüÃǽøÐд¦Àí¡£ÕýÔò±í´ïÊ½Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ