欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

JSP編程

當(dāng)前位置:主頁 > 網(wǎng)絡(luò)編程 > JSP編程 >

Properties 持久的屬性集的實(shí)例詳解

來源:本站原創(chuàng)|時(shí)間:2020-01-11|欄目:JSP編程|點(diǎn)擊: 次

Properties 持久的屬性集的實(shí)例詳解

特點(diǎn):

1、Hashtable的子類,map集合中的方法都可以用。

2、該集合沒有泛型。鍵值都是字符串。

3、它是一個(gè)可以持久化的屬性集。鍵值可以存儲(chǔ)到集合中,也可以存儲(chǔ)到持久化的設(shè)備(硬盤、U盤、光盤)上。鍵值的來源也可以是持久化的設(shè)備。

// 根據(jù)key讀取value  
  public void readValue(String filePath, String key) {  
  
    Properties props = new Properties();  
  
    InputStream in = new BufferedInputStream(new FileInputStream(filePath));  
//Thread.currentThread().getContextClassLoader().getResourceAsStream("eop.properties");  
  
    props.load(in); // 從輸入流中讀取屬性列表(鍵和元素對(duì))  
    String value = props.getProperty(key);  
  }  
  
  // 讀取properties的全部信息  
  public static void readProperties(String filePath) {  
    Properties props = new Properties();  
    InputStream in = new BufferedInputStream(new FileInputStream(filePath));    
    props.load(in);  
  
    Enumeration en = props.propertyNames();  
    while (en.hasMoreElements()) {  
      String key = (String) en.nextElement();  
      String value = props.getProperty(key);  
    }  
  }  

如有疑問請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

上一篇:在JSP中使用formatNumber控制要顯示的小數(shù)位數(shù)方法

欄    目:JSP編程

下一篇:web下載文件和跳轉(zhuǎn)的方法

本文標(biāo)題:Properties 持久的屬性集的實(shí)例詳解

本文地址:http://mengdiqiu.com.cn/a1/JSPbiancheng/11454.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有