JAVA×Ö·ûÁ÷ÎÊÌâ
×Ö·ûÁ÷µÄ¶ÁºÍд×îÖÕÔڵײ㶼ÊÇͨ¹ý×Ö½ÚÁ÷À´Íê³ÉµÄÂ𣿡¡¶ÁдÎı¾Îļþ×Ö·ûÁ÷Ó¦¸Ã¾Í¿ÉÒÔÁË°É¡£¡£
¸÷λ´ó¸ç´ó½ã°ï°ïæ°¢
JavaÁ÷°üÀ¨×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷£¬×Ö½ÚÁ÷ͨ¹ýIOÉ豸ÒÔ×Ö½ÚÊý¾ÝµÄ·½Ê½¶ÁÈ룬¶ø×Ö·ûÁ÷ÔòÊÇͨ¹ý×Ö½ÚÁ÷¶ÁÈëÊý¾Ýת»¯³É×Ö·û¡°Á÷¡±µÄÐÎʽÓÉÓû§Çýʹ¡£
Á÷¿ÉÒÔͨ¹ý°ü×°½øÐй¦ÄÜÉϵÄÀ©³ä£¬±ÈÈç˵BufferedStream£¬¿ÉÒÔ»º³åÁ÷£¬Ìá¸ß¶ÁÈ¡µÄÐÔÄÜ
¶ÁдÎı¾Îļþ×Ö·ûÁ÷¿ÉÒÔ
¿ÉÒÔʹÓÃBufferedInputStream
ÎÒÖªµÀ¶ÁÎļþ¿ÉÒÔÓÃ×Ö·ûÁ÷¡£µ«ÊÇÏñInputStreamReader(InputStream in) ÀïÃæµÄ²ÎÊýÓиö×Ö½ÚÁ÷¡£¡£FileReade£òÒ²ÊǼ̳ÐËû¡£ËùÒÔÎÒ¾õµÃÊDz»ÊǵײãÉÏÆäʵ×Ö·ûÁ÷µÄÊäÈëÊä³ö¶¼ÊÇ×Ö½ÚÁ÷Íê³ÉµÄ¡¡¶¼Àë²»¿ª×Ö½ÚÁ÷
Æäʵ×Ö·ûÁ÷ûÓÐʵ¼ÊµÄÐÎʽ£¬Ö»ÄÜÊÇͨ¹ý°üװһЩÌرðµÄÊäÈëÁ÷²ÅÄܽøÐÐ×Ö·û²Ù×÷£¬±ÈÈç˵°ü×°×Ö½ÚÁ÷InputStream£º
Reader reader = new InputStreamReader(System.in);
ÔÙ±ÈÈç˵°ü×°×Ö·ûÊý×飺
char[] in = new char[1024];
Reader reader = new CharArrayReader(in);
ËäÈ»²»ÊÇÎÒÏëÖªµÀµÄ¡£¡£»¹ÊÇллÁË
ÎÒ¾õµÃÄã˵µÄÊÇÕýÈ·µÄ¡£io°üµÄÆäËûµÄÀà»ù±¾¶¼¼Ì³Ð×Ôinput/outputstream»òÕß²ÉÓÃÁËÆäËûµÄÒÀÀµ¡£
û´í£¬ËùÓеÄÎļþ¶Áд¶¼ÊǶÔ×ֽڵIJÙ×÷£¬
¶Á×Ö·ûÁ÷Ò²ÊÇÏȶÁµÄ×Ö½ÚÁ÷£¬È»ºó°´Ä³ÖÖ±àÂëÐÎʽת»¯³É×Ö·û£¨n¸ö×Ö½Ú±íʾһ¸ö×Ö·û£©£¬
¶÷¡£¡£Á˽âÁË
InputStreamReader ÊÇÌØÊâµÄ
Ïà¹ØÎÊ´ð£º
ÎÒÄ¿Ç°ÔÚ±¾µØµÄlinuxÉÏдÁËÒ»¸öswingµÄ½çÃ棬Ïëͨ¹ýÕâ¸ö½çÃæÀ´¿ØÖÆÆäËüµçÄÔµÄlinuxÖØÆô¡£
ÎÒÖªµÀÓÃRuntime.getRuntime().exec("shutdown -r");¿ÉÒÔ¿ØÖƱ¾»úLinuxÖØÆô£¬µ«ÊÇÔõô¿ØÖÆÔ¶³ÌµÄlinuxÖØÆôÄØ£¿ ......
Ϊʲô·µ»ØjspÒ³Ãæµ½ä¯ÀÀÆ÷¶Ë²»´øÓÐjava´úÂë
´Ó·þÎñÆ÷·µ»Øä¯ÀÀÆ÷¶ËµÄµ½µ×ÊÇjspÒ³ÃæÖ»ÊÇһЩhtml´úÂë¡£Èç¹ûÊÇjspÒ³ÃæΪʲô¿´²»µ½ÄÇЩjava´úÂë¡£ µ½µ×ÓÐûÓаÑjspÖеÄjava´úÂë·µ»Ø·þÎñÆ÷¶Ë£¿
ä¯ÀÀÆ÷Ïò· ......
Çë½Ì´ó¼ÒÀ!!!!
ÄÄʲôÑù²»ÊÇ´¿javaµÄ£¿
ÎļþÉÏ´«Ã»Ê²Ã´ºÃ˵µÄ°¡ ½çÃæÉÏÉèÖÃÒ»¸ö input type=fileµÄ Ö¸¶¨Îļþ È»ºó ÓÃformfile½ÓÊÕ action»ñÈ¡µ½ÁË Ð´Èë´ÅÅÌ ¾ÍokÁË°¡
ʲô´¿²»´¿µÄ ÄÜ ......
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
package com;
import java.io.IOException;
import javax.servlet.jsp.PageContext;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import ......