java io ²Ù×÷дÈëword - Java / Web ¿ª·¢
public static void main(String[] args) throws Exception {
File file = new File("D:/Tools/apache-tomcat-5.5.28/webapps/j2w/upload/word.doc");
File file1 = new File("D:/Tools/apache-tomcat-5.5.28/webapps/j2w/upload/word1.doc");
File file2 = new File("D:/Tools/apache-tomcat-5.5.28/webapps/j2w/upload/word2.doc");
if (!file1.exists()) {
file1.createNewFile();
}
if (!file2.exists()) {
file2.createNewFile();
}
InputStream in = null;
InputStream in2 = null;
OutputStream out = null;
try {
// Ò»´Î¶ÁÒ»¸ö×Ö½Ú
in = new FileInputStream(file1);
in2 = new FileInputStream(file1);
out = new FileOutputStream(file);
SequenceInputStream sis = new SequenceInputStream(in, in2);
byte[] b = new byte[1];
while ((sis.read(b)) != -1) {
out.write(b);
}
out.flush();
in.close();
out.close();
} catch (Exception e) {
e.printStackTrace();
return;
}
}
ÎÊÌâÊÇÕâÑùµÄ£º
¹²ÓÐÈý¸öword
A.doc¡¢B.doc¡¢C.doc
A£¬B¶¼ÓÐÖµ¡£CÊǿյġ£ÎÒÏë°ÑA£¬BµÄÄÚÈݸøC¡£µ«ÊÇÃ÷ÏԵĿ´µ½ÁËCµÄÎļþ´óСµÄÈ·ÊDZä´óÁË£¬µ«ÊÇÀïÃæµÄÄÚÈÝÖ»ÓÐAµÄ»òÕßÊÇBµÄ¡£
»¹ÓÐÓÃ×·¼ÓµÄ·½Ê½¡£ÎÒÒ²ÊÔ¹ýÁË£¬»¹ÊDz»ÐС£ÖªµÀµÄÀÏÄñ¶¥Ò»Ï£¬½â¾öÁ¢¿ÌÉ¢·Ö
ÎÒÏë°ÑA¡£doc£¬B¡£docµÄÄÚÈÝдÈëC¡£doc£¬µ«ÊÇûÓгɹ¦£¬¿ÉÒÔ¿´µ½CµÄÎļþ´óСÃ÷ÏÔ±ä´ó£¬µ«ÊÇÀïÃæµÄÄÚÈݲ»ÕýÈ·
Ïà¹ØÎÊ´ð£º
ÓÐËÓÃjava×ö¹ý´òÓ¡·¢Æ±µÄ³ÌÐò£¬¸Ð¾õÕâ·½Ãæ²»ÊǺܺÿØÖÆ£¬Ï£Íû¸øµã½¨Ò飬×îºÃÄܸø³ö´úÂë
¼òµ¥µã¾Íµ÷ÓÃwindow.print()
ÄãÒ²¿ÉÒÔ°ÑÏÂÃæ´úÂë·Åµ½ÄãJSPÖÐ:
<html>
<head>
<title> ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
´ó¼ÒºÃ£¬ÎÒÏÖÔÚÓÐÒ»¸öÓÃaspдµÄÁÄÌìÊÒ£¬ÏÖÔÚµÄÏëÌí¼ÓÒ»¸ö¹¦ÄÜ£¬¾ÍÊǵ±ÓÐÈËÉÏÏßµÄʱºò£¬·¢³öÌáʾ£¬±ÈÈçÉùÒôÏìһϣ¬ÏÖÔÚÏëÓÃjavaʵÏÖÕâ¸ö¹¦ÄÜ£¬ÇëÎÊ´ó¼ÒÔõôʵÏÖ£¿
ллÁË£¬ÎÒ»á¼Ó·ÖµÄ
aspºÍjavaÕûºÏµ½Ò»ÆðÈ¥£¿ºÎ±Ø ......
ÔõôÑù½«id´«¹ýÈ¥°¡£¿£¿£¿ÊǼòµ¥µÄ´«¡£¡£¡£ÔÚµØÖ·À¸ÖÐдidºÅ
LZ ºÃÓÄĬ£¡²»ÖªµÀÄãµÄÒâ˼£¿
ÊÇÏë°ÑID ´«µ½ACTION ? ͨ¹ýURl id=?
²»¹»Ïêϸ ±ðÈ˲»ÖªµÀÔõÑù°ïÄã
../XXXXX.do?id=XXXX&id2=XXXXX
......
ÏÖÔÚ²»ÏëÓÃ<a> </a> ±êÇ© £¬ÒòΪµã»÷ºó»á³öÏÖÒ³ÃæÖØ¶¨Î»£¬¸øÎÄ×Ö¼ÓÉÏcssÑùʽ¾Í¿ÉÒÔ¿´ÆðÀ´ ÊÇhrefÔõôʵÏÖÕâÑùµÄcss
text-decoration:underline; cursor:hand;
ÒýÓÃ
text-decoration:underline; cur ......