Java µ÷ÓÃEXE
ʹÓÃRuntime.getRuntime().exec()·½·¨¿ÉÒÔÔÚjava³ÌÐòÀïÔËÐÐÍⲿ³ÌÐò.
¸Ã·½·¨ÓÐ6¸ö¿É·ÃÎÊ°æ±¾:
1.exec(String command)
2.exec(String command, String envp[], File dir)
3.exec(String cmd, String envp[])
4.exec(String cmdarray[])
5.exec(String cmdarray[], String envp[])
6.exec(String cmdarray[], String envp[], File dir)
Ò»°ãµÄÓ¦ÓóÌÐò¿ÉÒÔÖ±½ÓʹÓõÚÒ»°æ±¾,µ±Óл·¾³±äÁ¿´«µÝµÄʱºòʹÓúóÃæµÄ°æ±¾.
ÆäÖÐ2ºÍ6°æ±¾¿ÉÒÔ´«µÝÒ»¸öĿ¼,±êʶµ±Ç°Ä¿Â¼,ÒòΪÓÐЩ³ÌÐòÊÇʹÓÃÏà¶ÔĿ¼µÄ,ËùÒÔ¾ÍҪʹÓÃÕâ¸ö°æ±¾.
µ±ÒªÖ´ÐÐÅú´¦ÀíµÄʱºò,²»ÄÜÖ±½Ó´«µÝÅú´¦ÀíµÄÎļþÃû,¶øҪʹÓÃ:
cmd.exe /C start Åú´¦ÀíÎļþÃû
ʹÓÃdosÃüÁî(±ÈÈçdir)ʱҲҪʹÓõôµ÷ÓÃ.
Èç¹ûÏëÓëµ÷ÓõijÌÐò½øÐн»»¥,ÄÇô¾ÍҪʹÓø÷½·¨µÄ·µ»Ø¶ÔÏóProcessÁË,ͨ¹ýProcessµÄgetInputStream(),getOutputStream(),getErrorStream()·½·¨¿ÉÒԵõ½ÊäÈëÊä³öÁ÷,È»ºóͨ¹ýInputStream¿ÉÒԵõ½³ÌÐò¶Ô¿ØÖÆ̨µÄÊä³öÐÅÏ¢,ͨ¹ýOutputStream¿ÉÒÔ¸ø³ÌÐòÊäÈëÖ¸Áî,ÕâÑù¾Í´ïµ½Á˳ÌÐòµÄ½»»»¹¦ÄÜ.
Àý×ÓÈçÏÂ:
package com.broadcontact.netadmin.schedule;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Date;
import java.io.StringReader;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.File;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
/**
* <p>Title: netadmin</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company:
Ïà¹ØÎĵµ£º
import java.util.LinkedList;
import java.util.List;
public class ShortestPaths {
private static String showPath[] = { "", "", "", "", "", "" };
& ......
¹ØÓÚjavaµÄhttpÐÒéÎļþÉÏ´«ÊµÓÃÀýÌâÒ»
(2006-07-25 16:43:56)
תÔØ
·ÖÀࣺ
java
¹ØÓÚjavaµÄhttpÐÒéÉÏ´«:(¼òµ¥ÊµÓöøÇÒ½¡×³;Ëٶȿì)
´Ë·½·¨±ÈapacheµÄÎļþÉÏ´«°ü(uploadfile1.1:¾ÍÎļþÉÏ´«¹¦ÄܶøÑÔ)Ҫǿ¶àÁË
1.Ö»ÐèÒªÒ»¸öMultipartRequest.java»ù±¾Îļþ¾ÍÐС£
2.ǰ̨htmlµÄ»ù±¾¸ñʽ
<html ......
ѧϰ֮·×ÜÊDz¢²»Æ½Ì¹µÄ£¬Õâ²»£¬Ò»¿ªÊ¼¾ÍÓöµ½ÎÊÌâÁË£ºBad version number in .class file¡£°æ±¾²»¶Ô£¿¿ÉÊÇÎÒÓõÄjavaÒÔ¼°javac¶¼ÊÇJDK5ѽ£¬Ôõô»ØÊ£¿³ýÁ˱àÒë°æ±¾¸úÔËÐа汾²»Ò»ÖÂÍâÊDz»»á³öÏÖÕâÖÖ¿ÉÄܵġ£Í»È»ÏëÆðÇ°¼¸ÌìÊÔÁËÒ»ÏÂJDK6£¬°ÑEclipseµÄJDK±àÒëÆ÷Ñ¡³ÉJDK6ÁË¡£¹ûÈ»£¬½«Æä¸Ä»ØÈ¥JDK5¾ÍÐÐÁË¡£
================== ......
ƪÎÄÕÂÊÇ×î½ü¸Õ¿´µ½µÄ£¬ËäÈ»ÊÇ˵³ÌÐòÔ±´ÓC++תJAVAÐèҪעÒâµÄµØ·½£¬µ«ÊǺÜÏêϸµÄ˵³öÁËC++ºÍJAVAµÄ²»Í¬µÄµØ·½£¬¶ÔÓÚJAVAÖÐΪʲôûÓÐÖ¸Õ롢ΪʲôûÓÐÄÚ´æй¶¡¢½Ó¿ÚºÍC++ÖжàÖؼ̳еĹØϵ¡¢Òì³£»úÖƵÈÎÊÌâÒ²ÃèÊöµÄºÜÏêϸ£¬¹ÊתÔعýÀ´¡£
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉÎ ......
JavaÓïÑÔµÄ26¸öϸ½Ú[תÔØ]
Java×÷ΪһÃÅÓÅÐãµÄÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ,ÕýÔÚ±»Ô½À´Ô½¶àµÄÈËʹÓᣱ¾ÎÄÊÔͼÁгö×÷ÕßÔÚʵ¼Ê¿ª·¢ÖÐÅöµ½µÄһЩJavaÓïÑÔµÄÈÝÒ×±»È˺öÊÓµÄϸ½Ú,Ï£ÍûÄܸøÕýÔÚѧϰJavaÓïÑÔµÄÈËÓÐËù°ïÖú¡£
1£¬Î»ÒÆÔËËãÔ½½çÔõô´¦Àí
¿¼²ìÏÂÃæµÄ´úÂëÊä³ö½á¹ûÊǶàÉÙ?
int a=5;
......