操作Properties文件
2015-09-10 11:24
363 查看
src下的data.properties
name=LinDL
pwd=12345
name=LinDL
pwd=12345
<pre name="code" class="java">package test.lindl.mor; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class PropertiesTest { public static void main(String[] args) throws IOException { Properties properties=new Properties(); // InputStream inputStream=PropertiesTest.class.getClassLoader().getResourceAsStream("data.properties"); InputStream inputStream=new FileInputStream("d:/data.properties"); properties.load(inputStream); System.out.println("name: "+properties.getProperty("name")); System.out.println("pwd: "+properties.getProperty("pwd")); } }
相关文章推荐
- Android学习【1】——Android系统架构
- Centos6.5 安装Composer
- Linux系统中-/+ buffers/cache: 1397032 2752124 的意思
- ubuntu下配置nginx+php+mysql详解
- shell 获取 目录名 当前目录名
- 运维自动化之 Cobbler 系统安装使用详解
- Centos 6.6 install gcc-4.8.2
- 刚看到的apache的漏洞,可怕呀!!!
- 查看版本号
- Cacti - nginx -
- Linux远程管理
- Linux中与内核通信的Netlink机制(实例)
- [Linux][ubuntu][Perl]bad interpreter: No such file or directory
- Install VMWare Tools Ubuntu Server
- Linux下如何进行FTP设置
- linux下terminal快捷键
- JS+CSS实现电子商务网站导航模板效果代码
- Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-site-plugin:maven
- CentOS6.5安装和配置RabbitMQ3.5.4
- IIS服务器同时设置多个网站的三种方式