首页 > 代码库 > 配置文件读取,Properties类

配置文件读取,Properties类

Properties properties = new Properties();
FileInputStream fio = new FileInputStream("C:/Users/asus/Desktop/OOO/src/fdfs_client.conf");
properties.load(fio);
System.out.println(properties);

配置文件内容:

技术分享

输出结果:

{http.anti_steal_token=no, http_server=http://10.17.200.7/, http.tracker_http_port=8080, connect_timeout=2, http.secret_key=FastDFS1234567890, tracker_server=10.17.200.7:22122, charset=ISO8859-1, network_timeout=30}

 

配置文件读取,Properties类