- InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ipConfig.properties");
- Properties p = new Properties();
- try {
- p.load(inputStream);
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- System.out.println("ip:"+p.getProperty("ip")+",port:"+p.getProperty("port"));
java读取配置文件
最新推荐文章于 2024-09-24 16:30:00 发布