Properties类

  /*读*/ 
  Properties settings = new Properties();
  String name = "printConfig";
  try {
      FileInputStream in = new FileInputStream(name + ".properties"); 
      settings.load(in);
      String value = Integer.parseInt( (String) settings.get("name") ;

  } catch (IOException e) {e.printStackTrace();}

  /*写*/
  Properties settings = new Properties();
  String name = "printConfig";
  FileOutputStream out = null;
  try {
      out = new FileOutputStream( name + ".properties" );
      settings.store(out,"");
  } catch (Exception e1) {
      e1.printStackTrace();
  }

posted on 2006-10-17 16:07 国强 阅读(265) 评论(0)  编辑  收藏 所属分类: java


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


网站导航:
 
<2006年10月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

导航

统计

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

文章档案

收藏夹

java

搜索

最新评论

阅读排行榜

评论排行榜