1.使用java.util.Properties类的load()方法 //文件在项目下.不是在包下!! InputStream in = new BufferedInputStream(newFileInputStream("demo.properties")) ; Properties p = new Properties(); p.load(in) ; String className2 =p.getProperty("database.driver"); St
採用jxl.jar包,网上下载,百度一下到出都是.希望能够帮助到大家. 接下来直接贴代码: <span style="font-size:18px;"> public List getValue(String fileName){ String str=ExcelOparations.readExcel(fileName).trim(); String[] str4n= str.split("\n"); List list1 = new ArrayLis
读取resources下文件的方法 网上有问答如下:问: new FileInputStream("src/main/resources/all.properties") new FileInputStream("./src/main/resources/all.properties") 上面两个无法读取maven下资源文件目录下的文件嘛,总是提示找不到该路径,这么写错了嘛,但是我的其他maven可以读取 答: 要取编译后的路径,而不是你看到的src/main/re