當前位置:編程學習大全網 - 網站源碼 - 關於java socket 的問題

關於java socket 的問題

不忍心..

1. 寫個config.txt 內容如下:

ip = xxx.xxx.xxx.xxx

port = ####

2. 寫如下代碼獲取ip和port

Properties prop = new Properties();

InputStream in = new FileInputStream("config.txt");// full path

prop.load(in);

in.close(); // catach exception

String ip = (String)prop.get("ip");

String portValue = (String)prop.get("port");

自己整理下.. Properties 在 java.util 包裏面..

  • 上一篇:jQuery Dialog 登陸窗口
  • 下一篇:qq遊戲只能手機掃碼登錄
  • copyright 2024編程學習大全網