package com.javaniu;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
public class Main {
public static void main(String[] args) {
Properties property = new Properties();
try {
File file = new File("c:/db.properties");
if (!file.exists()) {
file.createNewFile();
}
// 写入
property.setProperty("database", "localhost");
property.setProperty("user", "javaniu");
property.setProperty("password", "password");
...
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/10292.html