`
1018
  • 浏览: 15592 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

读取文件数据

 
阅读更多
	public static String readFileData(String filePath,String key){
		String fileData = "";
		Properties p = new Properties();
		FileInputStream fs = null;
		try {
			fs = new FileInputStream(filePath);
			try {
				p.load(fs);				
				fileData = p.getProperty(key);
			} catch (IOException e) {
				e.printStackTrace();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();		}
     return fileData;
	}
	

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics