Properties類

寫Properties文件: 
       File f = new File( “****” ) ;
         FileOutputStream fos = new FileOutputStream(f) ;//
         Properties pp = new Properties() ;
         pp.setProperty( “ **** ” , “ ****  ” ) ;
         pp.store(fos,null) ;
         fos.close();

讀properties文件:
Properties p = new Properties();
FileInputStream fr;
   try {
                fr = new FileInputStream( “****” );
                p.load(fr);
                String  value = p.getProperty(" **** ")  ;     //取值
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (FileNotFoundException e) {
                e.printStackTrace();
       }

你可能感兴趣的:(F#)