import java.io.*;
import javax.swing.*;
class ReaderFile03
{
public static void main(String[] args)
{
String data;
try
{
String fpath = JOptionPane.showInputDialog("請輸入檔案路徑");
FileReader f = new FileReader(fpath);
BufferedReader bfin = new BufferedReader(f);
do
{
data = bfin.readLine();
if(data==null)
break;
System.out.println(data);
} while (true);
bfin.close();
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null,"輸入檔案路徑有誤!!");
}
catch (Exception e)
{}
System.exit(0);
}
}
arrow
arrow
    全站熱搜

    Neo Chao 發表在 痞客邦 留言(0) 人氣()