1. 程式人生 > >將字串寫入檔案

將字串寫入檔案

String     dataUrl = "aaaaaaasdasdasdsada";
File sf = new File("E:/team_project_store/BI/teamplate_plate/images/" + t1.getPath());
				
if(!sf.exists()) {
	sf.createNewFile();
}

FileOutputStream fos = new FileOutputStream(sf);
fos.write(dataUrl.getBytes());
fos.flush();
fos.close();