gpt4 book ai didi

Java 属性类附加日期

转载 作者:行者123 更新时间:2023-12-02 00:41:54 26 4
gpt4 key购买 nike

我正在使用 java 属性类通过此代码将值附加到我的配置文件。(我删除了错误处理等)

Properties configFile = new Properties();
configFile.setProperty(key, value);
configFile.store(new FileOutputStream("plugins/WirelessRedstone/receivers.properties", true), null);

当我附加键值对时,当前日期和时间会添加到我的键值对之前。示例#Thu May 26 03:39:59 EDT 2011

我怎样才能停止它?

非常感谢,乔达梅里奥

最佳答案

根据属性中存储方法的 Java 文档..它总是写该行

Next, a comment line is always written, consisting of an ASCII # character, the current date and time (as if produced by the toString method of Date for the current time), and a line separator as generated by the Writer.

您可以为此编写自己的存储方法。

关于Java 属性类附加日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6135305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com