我试图弄清楚为什么这不起作用。显示的所有文件实际上都存在。'logging.toString()' 是一个 .txt 文件,它读取日志中的所有文本,并使用我要添加的字符串将其写回。虽然当我这样做时,它会覆盖它。但我不想那样。帮助?
try{
FileWriter fstream = new FileWriter(logging.toString());
BufferedWriter out = new BufferedWriter(fstream);
FileInputStream fstreams = new FileInputStream(logging);
BufferedReader br = new BufferedReader(new InputStreamReader(fstreams));
String strLine;
while ((strLine = br.readLine()) != null){
htmlTextArea = htmlTextArea + strLine + "\n";
}
out.write(htmlTextArea + logto);
out.close();
} catch (Exception ex){}