簡單寫文件方法


File file = new File(...);
try {
  FileOutputStream fout = new FileOutputStream(file);
  PrintWriter pWriter = new PrintWriter(fout);
  pWriter.println("some text");
  pWriter.flush();
  pWriter.close();
  fout.close();
} catch(IOException re) {

}
相關文章
相關標籤/搜索