|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
import java.util.*; import java.io.*; public class Test1 { public String getPara(String fileName) { Properties prop= new Properties(); try { InputStream is = getClass().getResourceAsStream(fileName); prop.load(is); if(is!=null) is.close(); } catch(Exception e) { System.out.println(e+"file "+fileName+" not found"); } return prop.getProperty("file_name"); } public static void main(String[] args) { Test1 test = new Test1(); System.out.println(test.getPara("db.property")); } } 返回类别: 教程 上一教程: 学习如何使 JAVA 应用程序启动更快以及占用更少的内存 下一教程: JAVA动画编程基础第二部分 您可以阅读与"JAVA读取配置文件例子"相关的教程: · JAVA:配置文件读取器 · 用java读写ini配置文件 · 使用hibernate扩展工具hbm2java根据配置文件生成持久化对象类(2.1.2) · bug? Hbm2JavaTask无法实现joined-subclass单独配置文件(2.1.2) · 用java读写ini配置文件 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |