guanxf

我的博客:http://blog.sina.com.cn/17learning

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  71 随笔 :: 1 文章 :: 41 评论 :: 0 Trackbacks
1、配置文件(project.properties ):
  xzql.refFilePath=www.baidu.com
2、读取properties文件:
try{
        /* 创建输入流 */  
         InputStream is = this.getClass().getClassLoader().getResourceAsStream("project.properties"); 
          Properties p = new Properties();
      try {
     p.load(is);       //Properties 对象已生成,包括文件中的数据
      }catch(IOException e){
       e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
      }
      
      String refFp=p.getProperty("xzql.refFilePath");

posted on 2012-05-17 11:02 管先飞 阅读(354) 评论(0)  编辑  收藏 所属分类: Java技术

只有注册用户登录后才能发表评论。


网站导航: