| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
SimoneNewco
9年前发布

java读写Properties文件

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");  ...