----------------解决方案--------------------------------------------------------
应该就是一个io操作程序,可以直接带参数――就是文件名了,也可以使用线程,后者可能麻烦一点,推荐第一种方式
----------------解决方案--------------------------------------------------------
兄弟说明白点呀!!!
弄不出来急啊!!!
----------------解决方案--------------------------------------------------------
package io.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileReader;
import java.io.File;
import java.io.IOException;
public class IOTest{
public static void main(String[] args) throws IOException{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("please input filename");
String filename=in.readLine();
readFile(filename);
}
private static void readFile(String filename) throws IOException{
File file=new File(filename);
if(file.exists()&&file.isFile()){
BufferedReader buf=new BufferedReader(new FileReader(file));
String line=null;
while((line=buf.readLine())!=null){
System.out.println(line);
}
buf.close();
}else{
System.out.println("文件不存在");
}
}
}
----------------解决方案--------------------------------------------------------
还是BZ厚道
----------------解决方案--------------------------------------------------------
还有一个更简单的方法
那就是用type命令
比如
type xx.txt
----------------解决方案--------------------------------------------------------
借宝地问个问题,我把积分换钱了,能买魅力不 ?
----------------解决方案--------------------------------------------------------
多谢四楼的那位同志!!
这里真是藏龙卧虎啊
多多指教!!!!
----------------解决方案--------------------------------------------------------
还有一个更简单的方法
那就是用type命令
比如
type xx.txt
怎么弄得??
----------------解决方案--------------------------------------------------------
怎么弄得??
CMD里面的命令啊,怎么不可以,你试试就知道了
----------------解决方案--------------------------------------------------------