package com.qxm.soap;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
public class ReadProperties {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
ReadProperties rp = new ReadProperties();
rp.getPropertiesFile();
}
public void getPropertiesFile() throws Exception{
Properties pro = new Properties();
//InputStream is = this.getClass().getClassLoader().getResourceAsStream("d:\\a.properties");
InputStream is = new FileInputStream(new File("d:\\a.properties"));
pro.load(is);
System.out.println("a: "+pro.getProperty("export.types"));
System.out.println("ok");
}
}
java读取properties文件
最新推荐文章于 2023-01-10 09:27:15 发布