1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      java讀取系統(tǒng)Properties代碼實例-創(chuàng)新互聯(lián)

      這篇文章主要介紹了java 讀取系統(tǒng)Properties代碼實例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下

      為田東等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及田東網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都做網(wǎng)站、網(wǎng)站設(shè)計、外貿(mào)營銷網(wǎng)站建設(shè)、田東網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!

      java讀取系統(tǒng)Properties 屬性,針對配置較多的屬性值,單獨打印,實現(xiàn)代碼如下:

      import java.util.*;
       
      public class PropertiesTest {
       
        public static void main(String[] args) {
       
          Properties properties = System.getProperties();
          PropertiesTest pt = new PropertiesTest();
          Map map = pt.getSpecialMap(properties);
          //便于方便讀取,配置較多的屬性打印出來
          pt.showMap(map);
        }
       
       
        Map getSpecialMap(Properties properties){
       
          Set> props = properties.entrySet();
          Map map = new HashMap();
          Iterator> it = props.iterator();
          while (it.hasNext()) {
            Map.Entry entry = it.next();
            System.out.println("key= " + entry.getKey() );
            System.out.println("value= " + entry.getValue());
            if("java.library.path".equalsIgnoreCase("" + entry.getKey())) {
              map.put(entry.getKey()+"",entry.getValue()+"");
            }
            if("java.class.path".equalsIgnoreCase("" + entry.getKey())) {
              map.put(entry.getKey()+"",entry.getValue()+"");
            }
            if ("sun.boot.class.path".equalsIgnoreCase("" + entry.getKey())) {
              map.put(entry.getKey()+"",entry.getValue()+"");
            }
            if("java.ext.dirs".equalsIgnoreCase("" + entry.getKey())) {
              map.put(entry.getKey()+"",entry.getValue()+"");
            }
          }
          return map;
        }
       
       
        void showMap(Map map) {
          for (Map.Entry entry : map.entrySet()) {
            System.out.println("----------------------------------------------------");
            System.out.println(entry.getKey() +":");
            splitStr(entry.getValue());
            System.out.println("----------------------------------------------------");
          }
        }
       
        void splitStr(String string) {
          String[] str = string.split(";");
          for (int i = 0; i < str.length; i++) {
            System.out.println(str[i]);
          }
        }
      }

      另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站www.cdcxhl.com,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。


      本文名稱:java讀取系統(tǒng)Properties代碼實例-創(chuàng)新互聯(lián)
      當(dāng)前鏈接:http://ef60e0e.cn/article/pgcep.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        大安市| 甘泉县| 鄂托克旗| 曲周县| 宁安市| 镇江市| 休宁县| 庆元县| 苏州市| 民权县| 黄龙县| 扶余县| 清河县| 浦城县| 易门县| 贵南县| 台南县| 平安县| 四川省| 互助| 昂仁县| 广昌县| 板桥市| 陵川县| 南溪县| 鹤山市| 潜江市| 琼海市| 白河县| 会东县| 太白县| 揭阳市| 防城港市| 阳西县| 晋宁县| 西和县| 衡阳县| 湖口县| 石阡县| 略阳县| 类乌齐县|