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

JavaÈçºÎµ÷ÓÃÍⲿÍⲿÃüÁ

JavaÈçºÎµ÷ÓÃÍⲿÍⲿÃüÁ
ÎÒ×Ô¼ºµÄÌå»áÊÇÓÃRuntime.getRuntime.exec(cmd);
Æ©ÈçÏÂÃæÕâ¸ö´úÂ룺
String[] cmd = new String[3]£»
if( osName.equals( "Windows NT" )||osName.equals( "Windows 2000" ))
    {
     cmd[0] = "cmd.exe" ;
     cmd[1] = "/C" ;
    }
else if(osName.equals("Linux"))
   {
     cmd[0]="sh"
      cmd[1]£½linuxϵÄij¸öĿ¼
   }
    else if( osName.equals( "Windows 98" ) )
    {
     cmd[0] = "command.com" ;
     cmd[1] = "/C" ;
    }
    cmd[2] = "mysqldump --opt -u root yh_tpl > "+backup_path+filename+".sql";
    Process ps = Runtime.getRuntime().exec(cmd); 
½ñÌì¿´µ½Á˱ðÈ˻ظ´ÕâÀàÎÊÌ⣬ÓÐÕâÑùÒ»µãÒÔǰ²»ÖªµÀ£º
javaÖе÷ÓÃexecÍêÈ«ÍÑÀëÁËjavaµÄjvm£¬Òò´ËÒÔºóµÄÔËÐл·¾³ÐèÒª×Ô¼ºÎ¬»¤¡£
======================================================================================================
 Javaµ÷ÓÃÍⲿ³ÌÐòµÄ·½·¨
×÷Õߣº³Â¸Õ£¬¹ðÁÖÈË,97Äê±ÏÒµÓÚ¹ãÎ÷ʦ·¶´óѧÊýѧϵ£¬ÔÝÓÚIBMÖйúÑо¿ÖÐÐļæÖ°´ÓÊÂÈí¼þ¿ª·¢(2004.2-?)£¬×¨×¢»ùÓÚjavaƽ̨µÄÈí¼þ¿ª·¢¡£
email: glchengang@hotmail.com
blog: glchengang.yeah.net
×î½ü¿ª·¢±¨±íÄ£¿é£¬Éú³É±¨±íÎļþºó(Ò»¸öExcelÎļþ)Òª½«´ËÎļþ´ò¡£ºÜ¼òµ¥£¬Ê¹ÓÃJavaµ÷ÓÃÍⲿ³ÌÐòµÄ·½·¨¼´¿É¡£´úÂëÈçÏ£º
String path = "C:/±¨±í_20040504.xls";
try {
¡¡¡¡//Ï൱ÓÚwindowµÄ"¿ªÊ¼"->"ÔËÐÐ"µÄЧ¹û
Runtime.getRuntime().exec("cmd /c start " + path);
} catch (IOException e) {
e.printStackTrace();
}
µ«Èç¹ûÎļþµÄ·¾¶Öаüº¬ÓпոñÉÏÃæµÄ·½·¨¾Í»á³ö´í¡£µ½google¿ñËÑÒ»Æø,ûÓÐ,¿´cmd /?°ïÖúҲûÓÐ,ÊÔÁ˺öà´Î,·¢ÏÖ½â¾ö°ì·¨ÆäʵºÜ¼òµ¥,ÕæÊÇÓÞÃÁ¡£´úÂëÈçÏ£¬ÎÞÐë¶àÑÔ¡£
String path = "C:/Documents and Settings/Giles/×ÀÃæ/±¨±í_20040504.xls";
try {
Runtime.getRuntime().exec("cmd /c start excel \"" + path + "\"");
} catch (IOException e


Ïà¹ØÎĵµ£º

java¶ÁÈ¡ÎļþÄÚÈÝ£¨ÖÐÎÄÎļþ½â¾ö°ì·¨£©

ÖÚËùÖÜÖª£¬javaµÄÖÐÎÄÎÊÌâÒ»Ö±ÊÇÒ»¸öÀÏ´óÄѵÄÎÊÌ⣬Õâ¸öÏÖÏó¿ÉÒÔÔÚcsdnÖÐjavaÂÛ̳Àï¹ØÓÚÖÐÎÄÂÒÂëµÄÌáÎÊÂʾͿÉÒÔÁ˽⵽£¬ÉõÖÁÈí¼þ¾ÞÈËIBMרÃÅ¿ª±ÙÁËÒ»¸ö½â¾öÖÐÎÄÎÊÌâµÄ×¨Çø£¬×÷Ϊһ¸öË×ÈË£¨Ò»Ö±ÃÎÏëÏ£ÍûÏë½ð¿­ÀûÄÇÑù³ÉΪһ¸ö“Ã°ÅÆÌìÉñ”£¬Ö»ÊÇһֱûÓгɹ¦£¬Ò²ÐíÊÇÒòΪÉϵ۲»ÕÕ¹ËÖйú°É£©£¬ÎÒҲΪͬÒâµÄÎÊÌâÀ§ÈÅ£ ......

JAVAÀ¬»øÊÕ¼¯Ëã·¨µÄºËÐÄ˼Ïë

1.À¬»øÊÕ¼¯Ëã·¨µÄºËÐÄ˼Ïë
¡¡¡¡JavaÓïÑÔ½¨Á¢ÁËÀ¬»øÊÕ¼¯»úÖÆ£¬ÓÃÒÔ¸ú×ÙÕýÔÚʹÓõĶÔÏóºÍ·¢ÏÖ²¢»ØÊÕ²»ÔÙʹÓÃ(ÒýÓÃ)µÄ¶ÔÏ󡣸ûúÖÆ¿ÉÒÔÓÐЧ·À·¶¶¯Ì¬ÄÚ´æ·ÖÅäÖпÉÄÜ·¢ÉúµÄÁ½¸öΣÏÕ£ºÒòÄÚ´æÀ¬»ø¹ý¶à¶øÒý·¢µÄÄÚ´æºÄ¾¡£¬ÒÔ¼°²»Ç¡µ±µÄÄÚ´æÊÍ·ÅËùÔì³ÉµÄÄÚ´æ·Ç·¨ÒýÓá£
¡¡¡¡À¬»øÊÕ¼¯Ëã·¨µÄºËÐÄ˼ÏëÊÇ£º¶ÔÐéÄâ»ú¿ÉÓÃÄÚ´æ¿Õ¼ä£¬¼´¶Ñ¿Õ ......

Java¸ßÊÖÕæ¾­ÎªÄú¹æ»®Java¼¼ÊõÌåϵ

Java¼¼Êõ·Ïßͼ
Ìáʾ£ºÇ°ÎĶÔJava¼¼Êõ×öÁË¿ò¼ÜÐԵķÖÎö£¬°üÀ¨Java SE¡¢Java EEºÍJava ME£¬ÈöÁÕßÁ˽âÁËJavaÓÉÄÄЩ¼¼Êõ×é³É¡£ÎªÁËϵͳµØÑ§Ï°ÕâЩ¼¼Êõ£¬±¾ÎĽ«Öƶ¨Ò»Ì×ÍêÕûµÄJava¼¼Êõѧϰ·Ïß¡£
´ÓǰÎÄÖÐÎÒÃÇÒѾ­Á˽⵽£¬Java SEÖаüº¬ÁËJavaµÄ»ù´¡¼¼Êõ£¬Java EEÖаüº¬ÁËÍøÂçÓ¦Óÿª·¢µÄ¸÷ÖÖ¼¼Êõ£¬Java MEÖаüº¬ÁËÒÆ¶¯É豸Ӧ ......

javaÄÚ²¿Àà

ÌáÆðJavaÄÚ²¿ÀࣨInner Class£©¿ÉÄܺܶàÈ˲»Ì«ÊìϤ£¬Êµ¼ÊÉÏÀàËÆµÄ¸ÅÄîÔÚC++ÀïÒ²ÓУ¬ÄǾÍÊÇǶÌ×ÀࣨNested
Class£©£¬¹ØÓÚÕâÁ½ÕßµÄÇø±ðÓëÁªÏµ£¬ÔÚÏÂÎÄÖлáÓжԱȡ£ÄÚ²¿Àà´Ó±íÃæÉÏ¿´£¬¾ÍÊÇÔÚÀàÖÐÓÖ¶¨ÒåÁËÒ»¸öÀࣨÏÂÎĻῴµ½£¬ÄÚ²¿Àà¿ÉÒÔÔÚºÜ¶àµØ·½¶¨Ò壩£¬¶øÊµ
¼ÊÉϲ¢Ã»ÓÐÄÇô¼òµ¥£¬Õ§¿´ÉÏÈ¥ÄÚ²¿ÀàËÆºõÓÐЩ¶àÓ࣬ËüµÄÓô¦¶ÔÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ