ITeye博客

读取文件数据

1018 · 2011-04-30 11:23 · 编程语言 · Markdown

	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;
	}
	

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。