Topic: 请问:在Java中如何调用txt,doc等应用文件! |
Print this page |
1.请问:在Java中如何调用txt,doc等应用文件! | Copy to clipboard |
Posted by: duxing Posted on: 2006-06-16 22:51 各位大虾: 有指导在Java中如何调用txt,doc等应用文件的,告诉我一声! 谢谢! |
2.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: why Posted on: 2006-06-17 04:08 閣下想怎樣调用txt,doc等文件 創建,讀寫? doc裡有甚麼咚咚? |
3.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: sunjavaduke Posted on: 2006-06-19 16:56 使用 Runtime rt=Runtime.getRuntime(); try{ rt.exec(notepad);//运行记事本,windows环境下 } catch(......) {} 就可以了 若有不妥,还请回复 |
4.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: sunjavaduke Posted on: 2006-06-19 16:57 如果要执行其他文件,可能还要添加具体的路径名 eg. C:\Winnt\explorer.exe |
5.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: sunjavaduke] | Copy to clipboard |
Posted by: scottlai Posted on: 2006-06-19 17:34
|
6.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: duxing Posted on: 2006-06-19 21:29 各位 大虾! 我的意思是在Java程序中间 ,打开一个txt,doc(Word文件)文件 |
7.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: sunjavaduke] | Copy to clipboard |
Posted by: Skybus Posted on: 2006-06-19 22:32 sunjavaduke wrote: 这个程序不就是楼主要的吗 |
8.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: dwchang Posted on: 2006-06-25 19:07 楼主的意思是不是要读取,可用字节流或字符流。 字节流: FileInputStream fis=new FileInputStream(“C:\\a.txt"); //参数为路径+文件名 BufferedInputStream bis=new BufferedInputStream(fis); String str=bis.readLine();//读取首行 |
9.Re:请问:在Java中如何调用txt,doc等应用文件! [Re: duxing] | Copy to clipboard |
Posted by: jerryikitty Posted on: 2006-06-27 11:18 ^_^楼上的才是正解。不过好像语发有些问题。小弟不才指正一下: try { FileReader fr = new FileReader("C:\\a.txt"); BufferedReader br = new BufferedReader(fr); String str = br.readLine();// 读取首行 } catch (Exception exp) { // } |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |