public static void InInputFile(String fileName){
File file = new File(fileName);
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String tempString = null;
int line = 1;
// 壹次讀入壹行,直到讀入null為文件結束
while ((tempString = reader.readLine()) != null) {
syso(tempString);
line++;//行數
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}