public class SiteUrl {
private static Properties properties = new Properties();
static{
try {
//这个load()方法里面要一个 输入流,你能这样写吗?
//properties.load(new File("D:\\"))
properties.load(SiteUrl.class.getClassLoader().getResourceAsStream("siteurl.properties"));
} catch (IOException e) {
e.printStackTrace();
}
}
public static String readUrl(String key){
return (String)properties.get(key);
}
}