String userpath=application.getRealPath("/");
Properties prop = new Properties();
try {
  FileInputStream fis = new FileInputStream(new File(userpath + "ini/desc.ini"));
  prop.load(fis);
  if (fis != null) {
    fis.close();
  }
} catch (Exception ex) {
  System.out.println("打開文件出錯!");
}String sz等號右邊的內容=getStr(prop.getProperty("等號左邊的內容"));

解决方案 »

  1.   

    先谢了。
    楼上说的只是打开一般文本文件的方法吧,我要的是针对INI文件的操作,如何操作INI文件3要素:小节,关键字,值。
      

  2.   

    现在好象流行用xml格式作配置文件^-^。
      

  3.   

    的确,现在好像流行XML了,INI真的没人用了吗。
    看来我OUT了。
      

  4.   

    看看这个帖子:
    http://expert.csdn.net/Expert/TopicView1.asp?id=1985534