配置文件config.properties
photo.ip=127.0..0.1
photo.password=1111
photo.name=admin
资源读取类PropertiesReader.java
public class PropertiesReader {
public static ResourceBundle config = ResourceBundle
.getBundle("config");
}
获取参数
private String ipName = PropertiesReader.config.getString("photo.name");
private String ipPassword = PropertiesReader.config.getString("photo.password");
private String ipAdress = PropertiesReader.config.getString("photo.ip");