ini文件的读取
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties;
public class CalpisIni{
public static String getIniProperty(String path,String property){
Properties p = new Properties();
FileInputStream fs= null;
String value = "";
try {
fs = new FileInputStream(new File(path+"\\webadmin\\extension\\merchant.ini"));
p.load(fs);
if(p.containsKey(property)){
value = p.getProperty(property);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
try{
fs.close();
p=null;
}catch(Exception e ){
}
}
return value;
}
}