properties文件读取配置信息
public static void main(String[] args){ String printerName=""; String path = "C:\\BarCodeConfig\\Printer.properties"; Properties prop = new Properties(); FileInputStream fis; try { fis = new FileInputStream(path); prop.load(fis); fis.close(); printerName= prop.getProperty("printerName"); } catch (FileNotFoundException e) { System.out.println(e); } catch (IOException ex) { System.out.println(ex); } System.out.println("NAME:"+printerName); }