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

JAVA¶ÁÈ¡PPTÎļþ

import java.io.InputStream;
import org.apache.lucene.document.Document;
import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.TextRun;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;
public Document getDocument(Index index, String url, String title, InputStream is)
throws DocCenterException {
StringBuffer content = new StringBuffer("");
try{
SlideShow ss = new SlideShow(new HSLFSlideShow(is));//is ΪÎļþµÄInputStream£¬½¨Á¢SlideShow
Slide[] slides = ss.getSlides();//»ñµÃÿһÕÅ»ÃµÆÆ¬
for(int i=0;i<slides.length;i++){
TextRun[] t = slides[i].getTextRuns();//ΪÁËÈ¡µÃ»ÃµÆÆ¬µÄÎÄ×ÖÄÚÈÝ£¬½¨Á¢TextRun
for(int j=0;j<t.length;j++){
content.append(t[j].getText());//ÕâÀï»á½«ÎÄ×ÖÄÚÈݼӵ½contentÖÐÈ¥
}
content.append(slides[i].getTitle());
}
index.AddIndex(url, title, content.toString());
}catch(Exception ex){
System.out.println(ex.toString());
}
return null;
}


Ïà¹ØÎĵµ£º

JavaÃæÊÔÌâÕûÀí


<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:Verdana;
panose ......

ÎÒÓÃjavaдµÄÈÕÀú

public class Calendar {
 /**
  * Ö±½ÓµÄ¿ÉÒԲ鿴Ч¹û
  * @param args
  */
 public static void main(String[] args) {
  
  int year=input.nextInt();//Äê
  int month=input.nextInt();//ÔÂ
  int yearday=0;//Äê×ÜÌìÊý
  //¼ ......

JavaÖÐʹÓÃRuntimeºÍProcessÀàÔËÐÐÍⲿ³ÌÐò

ʹÓÃRuntime.getRuntime().exec()·½·¨¿ÉÒÔÔÚjava³ÌÐòÀïÔËÐÐÍⲿ³ÌÐò¡£
  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(S ......

Java ProcessÀàµÄdzѧϰ


½ñÌìÓÃÁËÏÂjava.lang.ProcessÀֻ࣬Êdzõ²½µÄѧϰ£¬²¢Ã»ÓÐÉîÈëʵ¼ù£¬ÒòΪ¸Ð¾õËüµÄÓÃ;²¢²»ÊǺܴó£¬Å¼¶û²Å¿ÉÄÜÓÃÉÏ£¬Èç¹ûÒª¾­³£Ê¹ÓÃËüµÄÈË¿ÉÒÔ×ÔÐвο¼JDkÎĵµ¡£
      ¶ÔProcessÀàµÄ¼òҪ˵Ã÷£º
     ProcessÀàÊÇÒ»¸ö³éÏóÀ࣬·½·¨¶¼ÊdzéÏóµÄ£¬Ëü·â×°ÁËÒ»¸ö½ø³Ì£¬Ò²¾ÍÊÇÒ»¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ