导入包
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
String path = this.getClass().getResource("/").getPath();
InputStream in = new BufferedInputStream(new FileInputStream(path+name));
Properties p = new Properties();
p.load(in);
通过p.getProperty("Statistic")就能获取文件中名字为Statistic的内容
.propertys中视力为:
Statistic=用户
Statisticmes=提醒
时间: 2024-10-06 12:48:16