<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sunspl

    Hello,everyone,i am sun. 天道酬勤,笨鳥先飛.
    隨筆 - 47, 文章 - 0, 評論 - 24, 引用 - 0
    數據加載中……

    J2SE API讀取Properties文件六種方法

    1。使用java.util.Properties類的load()方法示例:InputStreamin=lnewBufferedInputStream(newFileInputStream(name));Propertiesp=newProperties();p.load(in);

      2。使用java.util.ResourceBundle類的getBundle()方法示例:ResourceBundlerb=ResourceBundle.getBundle(name,Locale.getDefault());

      3。使用java.util.PropertyResourceBundle類的構造函數示例:InputStreamin=newBufferedInputStream(newFileInputStream(name));ResourceBundlerb=newPropertyResourceBundle(in);

      4。使用class變量的getResourceAsStream()方法示例:InputStreamin=JProperties.class.getResourceAsStream(name);Propertiesp=newProperties();p.load(in);

      5。使用class.getClassLoader()所得到的java.lang.ClassLoader的getResourceAsStream()方法示例:InputStreamin=JProperties.class.getClassLoader().getResourceAsStream(name);Propertiesp=newProperties();p.load(in);

      6。使用java.lang.ClassLoader類的getSystemResourceAsStream()靜態方法示例:InputStreamin=ClassLoader.getSystemResourceAsStream(name);Propertiesp=newProperties();p.load(in);

      補充

      Servlet中可以使用javax.servlet.ServletContext的getResourceAsStream()方法示例:InputStreamin=context.getResourceAsStream(path);Propertiesp=newProperties();p.load(in);

    posted on 2006-07-17 13:43 JavaSuns 閱讀(208) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲第一页综合图片自拍| 中文毛片无遮挡高清免费| 亚洲精品在线免费看| 亚洲国产成人在线视频| 亚洲综合一区国产精品| 人妻无码中文字幕免费视频蜜桃| 国产激情久久久久影院老熟女免费 | 九九免费久久这里有精品23| 久99久精品免费视频热77| 无码精品A∨在线观看免费| 日本成人在线免费观看| 亚洲国产精品自在拍在线播放 | 国产乱子伦精品免费女| 亚洲毛片在线观看| 亚洲女女女同性video| a在线观看免费视频| 成人毛片免费网站| 亚洲成色www久久网站夜月| 亚洲一区二区三区精品视频| 99视频在线免费观看| 亚洲电影日韩精品 | 青青草免费在线视频| 亚洲第一区香蕉_国产a| 一级做a毛片免费视频| 亚洲精品自产拍在线观看| 精品在线视频免费| 丁香花免费完整高清观看| 亚洲精品自产拍在线观看动漫| 91在线老王精品免费播放| 色噜噜亚洲精品中文字幕| 亚洲爆乳大丰满无码专区| 国产92成人精品视频免费| 久久精品亚洲中文字幕无码网站| 一级特黄a大片免费| 久久精品亚洲综合| 精品久久免费视频| 亚洲综合国产成人丁香五月激情| 免费在线观看a级毛片| 免费无码又爽又黄又刺激网站| 国产亚洲综合色就色| 天天操夜夜操免费视频|