Properties prop = new Properties();
InputStream inStream = null;
try
catch (FileNotFoundException e1)
{
//todo
}
catch (IOException e1)
{
//todo
}
finally
{
try
{
if (null != inStream)
{
inStream.close();
}
}
catch (IOException e1)
{
//todo
}
}
InputStream inStream = null;
try
{
//具体路径
prop.load(inStream);
Enumeration<String> e = (Enumeration<String>)prop.propertyNames();
String key = null;
String value = null;
String[] values = null;
boolean hasMoreElements = e.hasMoreElements();
while (hasMoreElements)
{
key = (String)e.nextElement();
value = prop.getProperty(key);
hasMoreElements = e.hasMoreElements();
}
catch (FileNotFoundException e1)
{
//todo
}
catch (IOException e1)
{
//todo
}
finally
{
try
{
if (null != inStream)
{
inStream.close();
}
}
catch (IOException e1)
{
//todo
}
}