日期:2014-05-20 浏览次数:21361 次
import java.io.*;
public class FileIn {
public static void main(String[] args) {
try {
FileInputStream rf = new FileInputStream(
"F:\\100个让心情变好的佛家领悟-佛家感悟.txt");
BufferedReader br=new BufferedReader(new InputStreamReader(rf));
// int b;
// while ((b = rf.read()) != -1)
// System.out.print((char) b);
// rf.close();
String s="";
while((s=br.readLine())!=null){
System.out.println(s);
}
br.close();
} catch (IOException ie) {
System.out.println(ie);
} catch (Exception e) {
System.out.println(e);
}
}
}
------解决方案--------------------
既然已经能够正常输出中文,那么楼主记得结贴
看你0结帖率 ……