java读取文本内容
java读取文本内容
public static String readHtmlContent(String htmlPath) throws IOException { String htmlContentStr = ""; File htmlFile = new File(htmlPath); FileReader fileReaderObj = new FileReader(htmlFile); BufferedReader bufferedReaderObj = new BufferedReader(fileReaderObj); String lineStr=""; while((lineStr=bufferedReaderObj.readLine())!=null) { htmlContentStr = htmlContentStr+lineStr; } bufferedReaderObj.close(); fileReaderObj.close(); return htmlContentStr; }
####################
QQ 3087438119